General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
>>Hi
>>
>>I want to pass a database name into my stored procedure and then use that database for everything that the stored procedure does.
>>
>>Whats the syntax for that ?
>>
>>Thanks
>
>You must use so called Dynamic SQL.
>BTW why you need this?
>If you call Database SP it will be executed for that DB, no matter to which DB you are connected.
Hi Boriss
I wanted to have a stored procedure in one database that could optionally be run against several other databases so I could pass in the database as a parameter.
So I can't do that ?
I have to have the stored procedure in the database its to run on ?
Thanks
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only