Retrieving a Database Name

  • How do you get the name of the database you are attached to if you do not have the database ID and vice a versa? Is there an SP or @@ or something? I am doing this for debugging purposes and need to make sure I am querying the correct database.

    Thank you in advanced for your help!

  • all you do is select db_name()

    or select db_id()

     

    -vishy

  • Thanks both of you. I knew it was something simple. I just wasn't seeing it.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply