Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 SQL Query to find out SQL2005 instance and DB?

Author  Topic 

Gopher
Yak Posting Veteran

83 Posts

Posted - 2008-01-18 : 10:35:00
Hi All

Does any one know a SQL 2005 query which will tel me what the server name or database names are?

Thanks

Gopher

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-01-18 : 10:42:52
[code]select @@servername --tell you the server name
select db_name() -- tell you current database name[/code]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

Gopher
Yak Posting Veteran

83 Posts

Posted - 2008-01-18 : 11:46:14
Cool - Thats great thanks!

Can you do the same for the SQL Version (i.e. 2000 SP4 or 2005 SP2)?
Go to Top of Page
   

- Advertisement -