Monday, November 6, 2006

SQL Server: What service pack am I on?

Anyone remember the SQL Slammer virus? It turns out that it attacked SQL Server databases (and SQL Server DBA's) that were not protected by the latest Service Pack. I sit around and scare myself by asking myself questions like, what service pack am I on?

Here is a simple query to tell you what service pack you are on and some other interesting information about your SQL Server instance:

select serverproperty ('servername') [Server Name],
serverproperty ('productversion') [Product Version],
serverproperty ('productlevel') [Product Level],
serverproperty ('edition') Edition,
serverproperty ('licensetype') [License Type],
serverproperty ('numlicenses') [# Licenses]

Of course you have to connect to the server you are interested in before running this query. The Service Pack level will be in the "Product Level" column.

No comments:

Post a Comment

I moderate comments blog posts over 14 days old. This keeps a lot of spam away. I generally am all right about moderating. Thanks for understanding.