Blog Maxi Accotto

Blog , cursos, coaching y Consultoria en SQL Server

 

 

 

Como saber la versión y service pack de nuestro SQL

Hay muchas veces que se necesita saber que edición, versión y service pack tenemos en nuestra instalación.

Para poder sacar esta información hay distintas formas, una de ellas es usar la siguiente query

 

SELECT @@VERSION 
 

Obteniendo como resultado el siguiente ejemplo

 

Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (Intel X86)
    Mar 29 2009 10:27:29
    Copyright (c) 1988-2008 Microsoft Corporation
    Developer Edition on Windows NT 6.0 <X86> (Build 6002: Service Pack 2)

 
Aquí podemos observar el tipo de edición (Developer) si es 32 o 64 bits, el nivel de Service pack del SO (SP2)
el build del SQL Server (10.0.2531.0) , su versión (SQL 2008) y hasta su service pack (SP1).
 
También podemos hacer esto mismo y además obtener mas información utilizando la función ServerProperty.
 
select SERVERPROPERTY('Edition') as Edicion,
       SERVERPROPERTY('ProductLevel') as ServicePack,
       
       case when
       
       substring(convert(varchar(15),
                 SERVERPROPERTY('ProductVersion')),
                 0,       
                 patindex('%.%',
                 convert(varchar(15),
                 SERVERPROPERTY('ProductVersion')))) = 8
       then '2000'           
       when 
       substring(convert(varchar(15),
                 SERVERPROPERTY('ProductVersion')),
                 0,       
                 patindex('%.%',
                 convert(varchar(15),
                 SERVERPROPERTY('ProductVersion')))) = 9
       then '2005'
       when 
       substring(convert(varchar(15),
                 SERVERPROPERTY('ProductVersion')),
                 0,       
                 patindex('%.%',
                 convert(varchar(15),
                 SERVERPROPERTY('ProductVersion')))) = 10
       then '2008' end as version,
       SERVERPROPERTY('Collation') as Collation,
       SERVERPROPERTY('InstanceName') as instancia
 
 

Currently rated 4.7 by 3 people

  • Currently 4.666667/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: How To
Posted by maccotto on Sunday, June 07, 2009 1:59 AM
Permalink | Comments (8) | Post RSSRSS comment feed

Comments