Whisper9999
Hall of Fame
Points: 3012
More actions
April 23, 2010 at 11:47 am
#94663
How can I tell what database I'm currently connected to using T-SQL? I know how to tell what instance I'm connected to, but I'm wondering if there is something like an @@DATABASE that one can use?
Cory E.
SSCertifiable
Points: 7076
April 23, 2010 at 11:48 am
#1157049
check out DB_NAME())
-- Cory
Raunak Jhawar
SSCoach
Points: 15701
May 4, 2010 at 3:04 am
#1161661
Hi,
This should solve your requirement.
SELECT DB_NAME()
Raunak J
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply