September 25, 2011 at 5:27 pm
OK - Thanks. What I will do is start from the beginning and post a new question about my indexes first to make sure I have that setup correct.
September 25, 2011 at 5:28 pm
I'll check it out. Thanks for everything!
September 25, 2011 at 9:39 pm
Seggerman-675349 (4/17/2008)
I am not sure of the feasibility of this but I would recommend writing your program to use a synonym for the table name - then use dynamic sql to create the synonym from whatever the table name is. Then DROP the synonym at the end. That way the logic of the stored procedure is static and only the synonym creation is dynamic.
And if two instances of the same proc run at the same time, what then? 😉
And, yeah... I realize the post is more than 3 years old but since this thread has been reactivated, I wanted to make sure folks knew this is likely a bad idea.
--Jeff Moden
Change is inevitable... Change for the better is not.
January 11, 2013 at 10:56 am
you may try this:
create a table type and define the table structure;
declare the SP that has a parameter of tble type;
declare a table type variable and reference the table type;
insert the data from your table to the variable;
Now you can pass the variable to the procedure and execute it.
Here is the link by Pinaldave
http://blog.sqlauthority.com/2008/08/31/sql-server-table-valued-parameters-in-sql-server-2008/
Good luck
Jessie
Viewing 4 posts - 16 through 18 (of 18 total)
You must be logged in to reply to this topic. Login to reply