Wednesday, March 21, 2012

name of current database

I want to know the name of current database
for make something like that
DECLARE @.db_name varchar(100)
SET @.db_name = [the name of current database]
USE master
...
...
USE @.db_name
:Da quick search of BOL reveiled db_name().

No comments:

Post a Comment