Wednesday, January 30, 2013

How to get Database ID and Name in Sql Server


To get a list of Database ID's and Names in your Sql Server use the below query.

SELECT [name],[dbid] FROM [master].[dbo].[sysdatabases] ORDER BY [name]

No comments:
Write comments
Recommended Posts × +