Tech blog

Friday, August 12, 2005

How to get the database id

select dbid from master..sysdatabases where [name]='databasename'

Here's how to get some helpful server information:

SELECT Name='ServerName', Value=SERVERPROPERTY('ServerName')
union
SELECT 'MachineName', SERVERPROPERTY('MachineName')
union
SELECT 'Edition', SERVERPROPERTY('Edition')
union
SELECT 'Engine Edition', SERVERPROPERTY('Engine Edition')
union
SELECT 'InstanceName', SERVERPROPERTY('InstanceName')
union
SELECT 'IsIntegratedSecurityOnly', SERVERPROPERTY('IsIntegratedSecurityOnly')
union
SELECT 'IsSingleUser', SERVERPROPERTY('IsSingleUser')
union
SELECT 'LicenseType', SERVERPROPERTY('LicenseType')
union
SELECT 'NumLicenses', SERVERPROPERTY('NumLicenses')
union
SELECT 'ProcessID', SERVERPROPERTY('ProcessID')
union
SELECT 'ProductVersion', SERVERPROPERTY('ProductVersion')
union
SELECT 'ProductLevel', SERVERPROPERTY('ProductLevel')

0 Comments:

Post a Comment

<< Home