Friday, February 21, 2014

How to get the ID of a database in SQL

To get the id of a database just execute the following built-in function:
  
--
-- This query will return the id of the specific database
--
  
SELECT db_id('my_database_name')