Hi,
I am pretty new to stored procedures and still learning about the processing capabilities of Transact-SQL. Can anyone show me how to do the following:
I have a stored procedure that will receive several parameters. One of those is @QuestionID. QuestionID is a foreign key in Table X, whose primary key is XPK. Every record in Table X that has the value in QuestionID that matches the value in the @QuestionID parameter needs to have a new child record inserted into Table Y. Table Y has a foreign key that points to XPK.
Given that the values of the fields to be inserted into Table Y are supplied in parameters, how do I write the logic that will do this in a stored procedure? What is the proper syntax?
Thank you for your help.
Thank you.
I am pretty new to stored procedures and still learning about the processing capabilities of Transact-SQL. Can anyone show me how to do the following:
I have a stored procedure that will receive several parameters. One of those is @QuestionID. QuestionID is a foreign key in Table X, whose primary key is XPK. Every record in Table X that has the value in QuestionID that matches the value in the @QuestionID parameter needs to have a new child record inserted into Table Y. Table Y has a foreign key that points to XPK.
Given that the values of the fields to be inserted into Table Y are supplied in parameters, how do I write the logic that will do this in a stored procedure? What is the proper syntax?
Thank you for your help.
Thank you.