DATETIME SELECT SELECT INTO DATE PAD STRING DYNAMIC SQL CURSOR MONEY FORMAT PERCENT STORED PROCEDURE SQL SERVER AGENT JOB OPTIMIZATION WHILE LOOP OVER PARTITION BY UPDATE
SITE SEARCH SQLUSA.com HEADLINES NEWS
SQL E/BOOKS  SQL 2012 PROGRAMMING  DOWNLOADS
SCRIPTS SQL 2005 SQL 2008 ARTICLES
SQL JOBS TWITTER FORMAT VIDEOS
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
DATETIME SELECT SELECT INTO DATE PAD STRING DYNAMIC SQL CURSOR MONEY FORMAT PERCENT STORED PROCEDURE SQL SERVER AGENT JOB OPTIMIZATION WHILE LOOP OVER PARTITION BY UPDATE