databaseid

  • I am running a trace to track sql performance. The trace file shows the databaseid. How to find database name from databaseid?

  • SELECT DB_NAME(database_id)



    --Jonathan

  • I recommend checking out the [SQL Books Online] for DB_NAME.

    Cheers,

    Ken

  • Just kidding, but wasn't that the same Jonathan already demonstrated?

    In Germany we have a saying that might translate to

    "All good things are three"

    So...

    I think SELECT DB_NAME(database_id) is what you are looking for. Take a look at BOL for explanation.

    ...too much coffee today, don't take it too serious and it's not offending.

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • How embarassing...

    I was so focused on answering the question that I didn't even -notice- Jonathan's reply (sorry about that, J...)

    Not -enough- coffee, rarely serious and never offended.  Thanks/humble apologies.  I'll make it up by standing in the corner of the chat room for a 10 minute timeout...

    Cheers,

    Ken

    BTW: Frank.  That profile pic is a classic, man.

  • That's a brilliant mindset

    You mean my avatar? I was multiple times in cinema with my elder son. He can almost recite the whole film, I guess.

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Thanks a lot for you all!!!!!

    SELECT DB_NAME(databaseid) is exactly what I am looking for.

     

    David

  • Hey, Ken,

    what is your avatar?

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Shamelessly stolen from a particular Gary Larson 'The Far Side' cartoon.

    Likeness is close but I have a beard...

     

  • Now that you've mentioned it.

    Hey, that guy Gary Larson is even known here in Germany.

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

Viewing 10 posts - 1 through 9 (of 9 total)

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