database as parameter to SP

  • Thread starter Thread starter alpha
  • Start date Start date
A

alpha

Hi friends,
can we pass database as input parameter to stored procedure. Then depanding upon the database passed query will be executed. We donot want it to done by using EXECUTE function in which database name is passed as string.


Bye,
Alpha
 
Hi,

I don't think you'll be able to do it.

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

alpha said:
Hi friends,
can we pass database as input parameter to stored
procedure. Then depanding upon the database passed query will be executed.
We donot want it to done by using EXECUTE function in which database name is
passed as string.
Bye,
Alpha
Community Website: http://www.dotnetjunkies.com/newsgroups/
 
Sure. You can test for any kind of string in a SP.
IF @DBWanted = 'DB1'
BEGIN ...

END


--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

alpha said:
Hi friends,
can we pass database as input parameter to stored
procedure. Then depanding upon the database passed query will be executed.
We donot want it to done by using EXECUTE function in which database name is
passed as string.
Bye,
Alpha
Community Website: http://www.dotnetjunkies.com/newsgroups/
 
Back
Top