Consider the following queries in which only the database name is different (on the same server)
Select * from sampledev.dbo.Sample Select * from sampleqa.dbo.Sample
The above requests are part of the procedure. Every time I have to start a procedure, I have to make sure that it refers to the correct database (and rename it if it is not).
I want to pass the database name as a parameter to a stored procedure. The question is, is this possible? If so, how?
Tilak source share