Monday, August 16, 2010

Get database ID from MS Sql Server

If you need to get the database ID quickly (for example you are using SQL profiler and need to filter by database ID)

One of the quickest ways I have found is to execute the following built-in function:

select db_id('yourdatabasename')


2 comments:

Lisandro Duran said...
This comment has been removed by the author.
Unknown said...

I am new to this. Can you tell me were to type that DB.id and those words?