Groups | Blog | Home
all groups > sql server programming > december 2003 >

sql server programming : Database ID


Jan Floris Van Der Wateren
12/8/2003 10:51:15 PM
Thank you to all your genuises out there who helped me with getting an
unique SQL server ID. I now have another problem. I must also get the
database ID. (Something about a/the GUID?) That must also be some or
other unique ID (numbers and\or digits)to identify the current database
you are working with.

Thank you
Jannie

*** Sent via Developersdex http://www.developersdex.com ***
Tibor Karaszi
12/9/2003 10:11:53 AM
The database is assign a numeric value, held in sysdatabases, when it is
created. This is the one that Roji refers to. This is unique in the SQL
Server instance (not two databases will have the same id). However, the same
db name created on two SQL Server can have different id (the id is basically
a sequential number).
Having said that, the database name is also unique. Any reason you don't use
that instead?

--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver


[quoted text, click to view]

Roji. P. Thomas
12/9/2003 12:37:02 PM
Something like

SELECT DB_ID() ???


--
Roji. P. Thomas
SQL Server Programmer
--------------------------------------
[quoted text, click to view]

AddThis Social Bookmark Button