|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, March 25, 2004 5:05 AM
Points: 5,
Visits: 1
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, December 12, 2005 4:42 AM
Points: 5,
Visits: 1
|
|
Thanks for code and explanation. I guess i could put the conditions in a separate table and use the data to create the parameters required for this stored procedure.
Edited by - rajenshah on 11/18/2003 02:28:04 AM
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, February 22, 2008 9:57 PM
Points: 2,
Visits: 4
|
|
I have problem with store procedure, I cant use strord procedure in my project..... SO can u tell me how to insert multiple table by code not procedure.....
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Friday, June 07, 2013 12:59 PM
Points: 483,
Visits: 1,103
|
|
I have made a copy of Narayana's sproc on my Northwind db. Also, I've made two copies of Employees table calling them Employees1 and Employee2.
When I exec the sp_multi_inserts sproc on Northwind database I get the following error:
Msg 156, Level 15, State 1, Line 2 Incorrect syntax near the keyword 'SELECT'.
Execute statement looks as follows: USE Northwind GO DECLARE @DELIMITER AS VARCHAR(200) DECLARE @INSERT_PART AS VARCHAR(2000) SET @DELIMITER = 'ZZZYYYXXX' SET @INSERT_PART = 'WHEN EMPLOYEEID < 5' + @DELIMITER + 'INTO EMPLOYEES1 (LASTNAME, FIRSTNAME VALUES (LASTNAME, FIRSTNAME)' + @DELIMITER + 'WHEN EMPLOYEEID >4' + @DELIMITER + 'INTO EMPLOYEES2 (LASTNAME, FIRSTNAME) VALUES (LASTNAME, FIRSTNAME)' EXEC SP_MULTI_INSERTS 'SELECT EMPLOYEEID, LASTNAME, FIRSTNAME FROM EMPLOYEES', @INSERT_PART, @DELIMITER, ''
What is wrong with how I'm executing the sproc?
|
|
|
|