How to know the ID of a database?

 Posted by Abhisek on 2/25/2010 | Category: Sql Server Interview questions | Views: 3427
Answer:

To know the ID of a database DB_ID function is used. It takes the database name as an argument.
DB_ID(dbName)


Example:- SELECT DB_ID(Student) -->5


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response