sklarbodds
asked on
Import table data into stored proc
I have a table that contains some contact data I need to import into my database.
Basically I need to know how to loop through the table and send each record to a stored proc that adds users like below (I know my syntax is way off). I don't know if I should use a while loop or what, but I need to have the table values for parameters in the stored proc.
SELECT FirstName, LastName, etc FROM dbo.Import
INTO usp_AddContact FirstName, LastName, etc
Basically I need to know how to loop through the table and send each record to a stored proc that adds users like below (I know my syntax is way off). I don't know if I should use a while loop or what, but I need to have the table values for parameters in the stored proc.
SELECT FirstName, LastName, etc FROM dbo.Import
INTO usp_AddContact FirstName, LastName, etc
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks to both of you, I ended up using the cursor because it seemed the most straightforward.
Greg
Open in new window