Author: mrssm | Posted on: 11/18/2008 10:45:29 AM | Views : 323

i am trying to write a store proc that inserts data into a table, this child table has a foreign key which references the primary key in the master table e.g.

master Table: User_Base

Field:
UB_ID int (PK)
UB_UserID varchar(50)

Child Table: User_Subscriptions
Field:
UC_ID int (PK)
UC_UserID: int
UC_Div int
UC_Region int
UC_Prior int

where UB_ID = UC_UserID relationship.

I am trying to insert data into the child table with the following stored proc:

CREATE PROCEDURE [dbo].[usp_IPM_Subscription_Insert]
- Add the parameters for the stored procedure here
@UserID int Go to the complete details ...