Thursday, June 4, 2015

get the sql server version

 We can get the sql server version by using this query :

DECLARE @ver nvarchar(128);
SET @ver = CAST(serverproperty('ProductVersion') AS nvarchar);
SET @ver = SUBSTRING(@ver, 1, CHARINDEX('.', @ver) - 1)

IF ( @ver = '7' )
   SELECT 'SQL Server 7'
ELSE IF ( @ver = '8' )
   SELECT 'SQL Server 2000'
ELSE IF ( @ver = '9' )
   SELECT 'SQL Server 2005'
ELSE IF ( @ver = '10' )
   SELECT 'SQL Server 2008/2008 R2'
ELSE IF ( @ver = '11' )
   SELECT 'SQL Server 2012'
ELSE
SELECT 'Unsupported SQL Server Version'
  

If you are searching life partner. your searching end with kpmarriage.com. now kpmarriage.com offer free matrimonial website which offer free message, free chat, free view contact information. so register here : kpmarriage.com- Free matrimonial website

Related Posts:

  • date function sql server Question  1 :  How to get current date time in sql server? Ans :           &nbs… Read More
  • REPLACE Function in sql server REPLACE  replaces part of a text string, based on the number of characters you specify, with a different text string. Syntax : REPLACE(… Read More
  • SQL FULL JOIN SQL FULL JOIN Keyword The FULL JOIN keyword return rows when there is a match in one of the tables. SQL FULL JOIN Syntax SELECT column_name(s) FR… Read More
  • SQL RIGHT JOIN SQL RIGHT JOIN Keyword The RIGHT JOIN keyword returns all the rows from the right table (table_name2), even if there are no matches in the left tab… Read More
  • date time format in sql server Question  1 :  How to get current date time in sql server? Ans :           &nbs… Read More

0 comments:

Post a Comment