Jul 20, 2005 #1 nacrotek Programmer Joined Jul 20, 2005 Messages 5 Location US Is there a hidden @@ variable, sp_ proc, or other feature which you can query to get the name of the current DB? I'm looking for something like: declare @currentDBName varchar(100) select @currentDBName = <get current DB name> Thanks in advance
Is there a hidden @@ variable, sp_ proc, or other feature which you can query to get the name of the current DB? I'm looking for something like: declare @currentDBName varchar(100) select @currentDBName = <get current DB name> Thanks in advance
Jul 20, 2005 #2 NoCoolHandle Programmer Joined Apr 10, 2003 Messages 2,321 Location US select db_name() Upvote 0 Downvote