Thursday, March 29, 2012

database name

When using query analyzer i need to know what database the scripts is
running on and store that name into a variable. is there a global database
name variable? I know about @.@.servername but no @.@.databasename :(DB_NAME()
David Portas
SQL Server MVP
--
"eg" <emil@.dbworks.com> wrote in message
news:u$CXluRnFHA.3960@.TK2MSFTNGP12.phx.gbl...
> When using query analyzer i need to know what database the scripts is
> running on and store that name into a variable. is there a global database
> name variable? I know about @.@.servername but no @.@.databasename :(
>|||select db_name()
"eg" wrote:

> When using query analyzer i need to know what database the scripts is
> running on and store that name into a variable. is there a global database
> name variable? I know about @.@.servername but no @.@.databasename :(
>
>|||ty
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:roqdnX7ixsVdlGTfRVn-1A@.giganews.com...
> DB_NAME()
> --
> David Portas
> SQL Server MVP
> --
> "eg" <emil@.dbworks.com> wrote in message
> news:u$CXluRnFHA.3960@.TK2MSFTNGP12.phx.gbl...
>

No comments:

Post a Comment