Thursday, July 12, 2007 9:02 PM
I have written the following store procedure in SQL server express 2005. But I get the above result when I parse it. Anyone for a tip?
CREATEPROCEDURE procInsertClient -- Add the parameters for the stored procedure here
BEGIN-- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; INSERT INTO ClientHeader (FirstName, LastName, Phone, Email) VALUES (@FirstName, @LastName, @Phone, @Email)
BEGININSERT INTO ClientDetails (Interest, Newsletter) VALUES (@Interest, @Newsletter)
Thursday, July 12, 2007 9:10 PM
Your stored procedure definition ends with the first GO statement.
Remove the lines END GO BEGIN in the middle so the whole SP is bracketed by a single BEGIN...END pair
Thursday, July 12, 2007 9:13 PMModerator
It is the GO:
GO seperates batches and variables are scoped to batches. So if you want the insert to be part of the process, you need to remove the GO.
I don't understand the two inserts anyhow. How is the header related to the details? Can you post your tables for the discussion?
Friday, July 13, 2007 1:39 AM
I got a bit confused to be honnest. I should have used a join.
Anyway, I have sorted the problem, Iam only using 1 table since there aren't that many fields.
Thanks a lot for your help.