datetime tune date into pad dynamic cursor money percent sp job isnumeric while over update
FREE TRIAL  SQL 2012 PROGRAMMING  SEARCH
SQL Server Scripts SQL 2005 SQL 2008 Articles
SQL JOBS NEWS FORMAT DEV JOBS
How to tell server edition, version and service pack number?

Execute the following SQL Server T-SQL script in Management Studio Query Editor to find SQL Server edition, version and Service Pack SP#; also a SQLCMD script to find out all the SQL Server intances running on the network.

-- SQL Server version and edition - sql server serverproperty

USE master;

GO

SELECT

'Microsoft SQL Server ' +

convert(varchar, SERVERPROPERTY('ProductVersion') ) + ' -- ' +

convert(varchar, SERVERPROPERTY('ProductLevel') ) + ' -- ' +

convert(varchar, SERVERPROPERTY('Edition') ) + ' -- ' +

convert(varchar, SERVERPROPERTY('EngineEdition') ), @@VERSION ;

GO

-- Microsoft SQL Server 10.0.2531.0 -- SP1 -- Enterprise Edition -- 3

 

-- The following RESULT WILL GO TO Messages

-- EXEC sp_dbcmptlevel YourDatabaseName

 

EXEC sp_dbcmptlevel AdventureWorks2008

GO

-- The current compatibility level is 100.

 

 

-- T-SQL find all SQL Server instances CURRENTLY RUNNING

-- Check for sql server instances installed

DECLARE @CMD varchar(256) = 'SQLCMD /L'

CREATE TABLE #Info (Line nvarchar(256))

INSERT #Info

EXEC xp_cmdshell @CMD

DELETE #Info WHERE Line is null or Line =''

SELECT * FROM #Info

DROP TABLE #Info

/* Results

Servers:

    DELLSTAR

    DELLSTAR\ALPHA

    DELLSTAR\SQL2008

    DELLSTAR\SQL2K

    GATESTAR

    GATESTAR\SQL2000

    GATESTAR\SQL2008

*/

Exam Prep 70-461
Exam 70-461