09 June,2015 by Tom Collins
Question: How can I check programmatically the SQL Server service pack? I’d like to check all SQL Servers , create a report detailing the service pack levels.
Answer: The SERVERPROPERTY('productlevel') returns the service pack level. To make a useful decision I like to present some extra information.
I include Server Name, Build Level, SQL Server Edition, Server or Default Collation,Instance Name, LCID
SELECT SERVERPROPERTY('servername') as 'Server Name', SERVERPROPERTY('productversion') as 'Build Level', SERVERPROPERTY('productlevel') as 'Patch Level', SERVERPROPERTY('edition') as 'SQL Server Edition', SERVERPROPERTY('buildclrversion') as 'CLR version', SERVERPROPERTY('collation') as 'Server Collation', SERVERPROPERTY('instancename') as 'Instance Name', SERVERPROPERTY('lcid') as 'LCID'
SQL Server Version with Powershell - SQL Server DBA
SQL Server – Get SQL Server Version - SQL Server DBA
How to find SQL License type - SQL Server DBA
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |