September 17, 2002 at 11:43 pm
Is there a stored procedure that can be called to give a Database ID?
Matt Hallewell.
September 18, 2002 at 12:20 am
this'll work
select dbid from master.dbo.sysdatabases
where name = db_name()
Not sure if there's an sp that does the same
cheers,
Mike
September 18, 2002 at 12:55 am
SELECT db_id('pubs')
Chris Hedgate @ Apptus Technologies (http://www.apptus.se)
September 18, 2002 at 2:09 am
doh - I should've found that given it's next to db_name in the help index.
Incidently - If you leave out the name it'll return the current database id.
cheers,
Mike
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply