June 16, 2006 at 11:40 am
I want to use the TABLE_NAME column from executing
sp_tables @table_type = "'TABLE'"
as a parameter to my stored procedure; is there a way to do that?
June 16, 2006 at 11:58 am
June 16, 2006 at 12:11 pm
Sure, I have four stored procedures that create stored procedures (prMakeDeleteRecordProc, prMakeInsertRecordProc, prMakeSelectRecordProc, prMakeUpdateRecordProc) and they each take a table name is an input parameter. I want to loop through all of my table names and execute each of the four procs for each table name.
June 16, 2006 at 12:46 pm
Have you considered trying to use sp_MSforeachtable? It's rather a bit like sp_MSforeachtable where it will loop through your tables running your command on each tablename. sicne you have 4 procedures you'd need to run it twice, but it may save you a good bit of headache. You can read about it here.
HTH -Luke.
June 16, 2006 at 1:05 pm
Thanks Luke, works perfectly!
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply