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
 General SQL Server Forums
 New to SQL Server Programming
 Refer to "this" database with a pointer

Author  Topic 

DeepGround
Yak Posting Veteran

73 Posts

Posted - 2011-07-26 : 19:14:56
Hello,

I want to run a stored procedure that requires as input the name of the database to return info for. I don't know the name of the database but the script will be run against that database. Is there a "this" pointer I can use?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-07-26 : 19:20:45
SELECT DB_NAME()

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

DeepGround
Yak Posting Veteran

73 Posts

Posted - 2011-07-26 : 19:59:54
Thanks tkizer!
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-07-26 : 20:01:45


Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -