@@Database

  • 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?

  • check out DB_NAME())

    -- Cory

  • 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