Sql-determine the version and edition of SQL Server

How to determine the version and edition of SQL Server:



In this post we want to get all server information my sql query. In this information Include sql server version, Sql server client information, information about sql tables (how many tables are created in database). Etc.

This Post describes how to determine your current Microsoft SQL Server version number or service pack level by Query. We can also describes how to determine the specific edition of SQL Server that you are using.

When we are talking about Sql Server then we can get fallowing information by sql query.
In SQL Server, the following information is returned.

  • SQL Server version
  • Processor architecture
  • SQL Server build date
  • Copyright statement
  • SQL Server edition
  • Operating system version


SQL Server
Version

Which versions of Sql sever you are running.
SELECT @@VERSION
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('edition')
SERVERPROPERTY Ãƒ¨ Returns property information about the server instance.
For more ServerProperty details: http://msdn.microsoft.com/en-us/library/ms174396.aspx

Client
Client details (IP Address, Machine Name, Instance using).
SELECT con.client_net_address as IPAddress,
         sess.host_name as MachineName, sess.program_name asApplicationName,
         login_name as LoginName
FROM sys.dm_exec_connections con
inner join sys.dm_exec_sessions sess
on con.session_ID=sess.session_ID
WHERE con.session_ID = @@SPID


Show all Function/Procedure/Table/View ECT
select distinct type, name from sysobjects

Tables
EXEC sp_help 'temp'
Select * From Information_Schema.TABLES
Select * From Information_Schema.columns 

Sql Server Interview Qus:


SQL Server 2005 version information:

Release   Product  and version
  • SQL Server 2005 Service Pack 4 version  9.00.5000.00.
  • SQL Server 2005 Service Pack 3  version  9.00.4035.
  • SQL Server 2005 Service Pack 2  version  9.00.3042.
  • SQL Server 2005 Service Pack 1  version  9.00.2047.
  • SQL Server 2005 RTM     version  9.00.1399.

SQL Server 2008 version information:

Release  Product  and  version
  • SQL Server 2008 Service Pack 3  version  10.00.5500.00
  • SQL Server 2008 Service Pack 2  version  10.00.4000.00
  • SQL Server 2008 Service Pack 1 version  10.00.2531.00
  • SQL Server 2008 RTM version  10.00.1600.22

SQL Server 2008 R2 version information:


Release  Product and version
  • SQL Server 2008 R2 Service Pack 3 version 10.50.6000.34
  • SQL Server 2008 R2 Service Pack 2 version 10.50.4000.0
  • SQL Server 2008 R2 Service Pack 1 version 10.50.2500.0
  • SQL Server 2008 R2 RTM               10.50.1600.1


Related Post/Reference :


Comments

Popular posts from this blog