Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Running a stored procedure against different tables

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-09-07 : 09:57:00
Tom writes "I would like to create a stored procedure which I could run against a number of tables, each of which has the same structure, by specifying the table name as a parameter to the query. Something like:

create procedure [sp_checklog] @serv [varchar] as
select * from @serv...

This logic does not seem to work. Am I doing something wrong? If so, how do I make this work? Is this sort of thing not possible?

Thanks!

Tom"
   

- Advertisement -