{"id":191,"date":"2006-11-15T17:50:04","date_gmt":"2006-11-15T16:50:04","guid":{"rendered":"http:\/\/www.galhano.com\/blog\/?p=191"},"modified":"2016-01-22T13:02:15","modified_gmt":"2016-01-22T13:02:15","slug":"como-saber-que-versao-do-sql-server-estou-a-correr","status":"publish","type":"post","link":"http:\/\/galhano.com\/blog\/?p=191","title":{"rendered":"Como saber que vers\u00c3\u00a3o do SQL Server estou a correr?"},"content":{"rendered":"<p>2012<\/p>\n<p>[sql]<\/p>\n<p>SELECT &#8216;SQL Server &#8216;<br \/>\n+ CAST(SERVERPROPERTY(&#8216;productversion&#8217;) AS VARCHAR)<br \/>\n+ &#8216;-&#8216;<br \/>\n+ CAST(SERVERPROPERTY(&#8216;productlevel&#8217;) AS VARCHAR)<br \/>\n+ &#8216; (&#8216;<br \/>\n+ CAST(SERVERPROPERTY(&#8216;edition&#8217;) AS VARCHAR)<br \/>\n+ &#8216;)&#8217;<\/p>\n<p>[\/sql]<\/p>\n<p><span style=\"font-family: Verdana; font-size: small;\"><span style=\"color: #efefef;\"> <span style=\"background-color: #a52a2a;\">SQL Server 7.0, 2000, and 2005,<\/span><\/span> running the following will extract ONLY the version information.<br \/>\n<\/span><\/p>\n<table id=\"table1\" border=\"0\" cellspacing=\"0\" cellpadding=\"10\">\n<tbody>\n<tr>\n<td class=\"code\" bgcolor=\"#efefef\"><span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">SELECT LTRIM(RIGHT(LEFT(@@VERSION,38),9))<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-family: Verdana; font-size: small;\"><br \/>\nAnd the following query will work on SQL Server 2000 and up:<br \/>\n<\/span><\/p>\n<table id=\"table2\" border=\"0\" cellspacing=\"0\" cellpadding=\"10\">\n<tbody>\n<tr>\n<td class=\"code\" bgcolor=\"#efefef\"><span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">SELECT &#8216;SQL Server &#8216;<br \/>\n+ CAST(SERVERPROPERTY(&#8216;productversion&#8217;) AS VARCHAR) + &#8216; &#8211; &#8216;<br \/>\n+ CAST(SERVERPROPERTY(&#8216;productlevel&#8217;) AS VARCHAR) + &#8216; (&#8216;<br \/>\n+ CAST(SERVERPROPERTY(&#8216;edition&#8217;) AS VARCHAR) + &#8216;)&#8217;<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-family: Verdana; font-size: small;\"><!--more--><br \/>\n<\/span><span style=\"color: #efefef; font-family: Verdana;\"><strong> <span style=\"background-color: #a52a2a;\">SQL Server 2000 \/ 2005<\/span><\/strong> <\/span><\/p>\n<p><span style=\"font-family: Verdana; font-size: small;\">If you are running SQL Server 2000, please see the new and dynamic <a title=\"http:\/\/www.aspfaq.com\/sql2000Builds.asp\" href=\"http:\/\/www.aspfaq.com\/sql2000Builds.asp\" target=\"_blank\"> SQL Server 2000 Build Chart<\/a>.<\/span><\/p>\n<p><span style=\"font-family: Verdana; font-size: small;\">If you are running SQL Server 2005, please see the following article: <a title=\"What version of SQL Server 2005 do I have?\" href=\"http:\/\/www.aspfaq.com\/sql2005\/show.asp?id=20\" target=\"_blank\"> What version of SQL Server 2005 do I hav&#8230;<\/a><\/span><\/p>\n<p><span style=\"font-family: Verdana; font-size: small;\">Want to find out who installed a specific HotFix? The following registry key will have a sub-key for each build number (e.g. there will be a key called &#8220;0818&#8221; for 8.00.818) with values for DateInstalled, InstalledBy, and KBArticle.<\/span><\/p>\n<table id=\"table3\" border=\"0\" cellspacing=\"0\" cellpadding=\"10\">\n<tbody>\n<tr>\n<td class=\"code\" bgcolor=\"#efefef\"><span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MSSQLServer\\HotFixes\\<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-family: Verdana; font-size: small;\"><br \/>\n<span style=\"color: #efefef;\"><span style=\"background-color: #a52a2a;\"><strong>MSDE<\/strong> <\/span><\/span><\/span><\/p>\n<p><span style=\"font-family: Verdana; font-size: small;\">If you are using MSDE, you can use osql (other products might tell you with less effort; see <a title=\"http:\/\/www.aspfaq.com\/show.asp?id=2442\" href=\"http:\/\/www.aspfaq.com\/show.asp?id=2442\" target=\"_self\"> Article #2442<\/a>).<br \/>\n<\/span><\/p>\n<table id=\"table4\" border=\"0\" cellspacing=\"0\" cellpadding=\"10\">\n<tbody>\n<tr>\n<td class=\"code\" bgcolor=\"#efefef\"><span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">osql -E -q&#8221;SELECT @@VERSION&#8221;<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-family: Verdana; font-size: small;\"><br \/>\nYou may need to determine whether MSDE is running as a default instance or a named instance. Look in the Services applet and find services starting with MSSQLSERVER. For example, if you have a service named MSSQLSERVER$MYSERVER, you have a named instance called MYSERVER. So, you can use the following to return version information at a command prompt:<br \/>\n<\/span><\/p>\n<table id=\"table5\" border=\"0\" cellspacing=\"0\" cellpadding=\"10\">\n<tbody>\n<tr>\n<td class=\"code\" bgcolor=\"#efefef\"><span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">osql -S&#8221;.\\MYSERVER&#8221; -q&#8221;SELECT @@VERSION&#8221;<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-family: Verdana; font-size: small;\">To determine the service pack that&#8217;s installed on your SQL Server, open ISQLW (Query Analyzer) or ISQL or OSQL. Connect to your server. Execute the following command:<\/span><\/p>\n<table id=\"table7\" border=\"0\" width=\"169\" cellspacing=\"0\" cellpadding=\"10\">\n<tbody>\n<tr>\n<td class=\"code\" bgcolor=\"#efefef\"><span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">SELECT @@VERSION<br \/>\nGO<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-family: Verdana; font-size: small;\">The output of this command will be something like the one pasted below. The first line of the output displays the version number of the server. The last 3 digits (build number) of the version number are used to determine the service pack installed on your SQL Server. In this case 623.<\/span><\/p>\n<p><span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">Microsoft SQL Server 7.00 &#8211; 7.00.623 (Intel X86)<br \/>\nNov 27 1998 22:20:07<br \/>\nCopyright (c) 1988-1998 Microsoft Corporation<br \/>\nStandard Edition on Windows NT 4.0 (Build 1381: Service Pack 6)<\/span><\/p>\n<p><span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">(1 row(s) affected)<br \/>\n<\/span><\/p>\n<table id=\"table6\" border=\"0\" width=\"100%\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td bgcolor=\"#c0c0c0\">\n<p align=\"center\"><strong><span style=\"color: #efefef; font-family: Verdana; font-size: small;\"><span style=\"background-color: #a52a2a;\">SQL Server Version Table:<\/span><\/span><\/strong><\/p>\n<\/td>\n<td align=\"center\" bgcolor=\"#c0c0c0\"><span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">No SP<br \/>\n(RTM or Golden)<\/span><\/td>\n<td align=\"center\" bgcolor=\"#c0c0c0\"><span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">SP1<\/span><\/td>\n<td align=\"center\" bgcolor=\"#c0c0c0\"><span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">SP2<\/span><\/td>\n<td align=\"center\" bgcolor=\"#c0c0c0\"><span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">SP3 \/ SP3a<\/span><\/td>\n<td align=\"center\" bgcolor=\"#c0c0c0\"><span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">SP4<\/span><\/td>\n<td align=\"center\" bgcolor=\"#c0c0c0\"><span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">SP5<\/span><\/td>\n<td align=\"center\" bgcolor=\"#c0c0c0\"><span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">SP5a<\/span><\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#c0c0c0\"><span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">SQL Server 6.0<\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><span style=\"font-family: Verdana; font-size: small;\"> 6.00.121<\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><span style=\"font-family: Verdana; font-size: small;\"> 6.00.124<\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><span style=\"font-family: Verdana; font-size: small;\"> 6.00.139<\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><span style=\"font-family: Verdana; font-size: small;\"> 6.00.151 <\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#c0c0c0\"><span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">SQL Server 6.5<br \/>\n(Hydra)<\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><span style=\"font-family: Verdana; font-size: small;\"> 6.50.201<\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><span style=\"font-family: Verdana; font-size: small;\"> 6.50.213<\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><span style=\"font-family: Verdana; font-size: small;\"> 6.50.240<\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><span style=\"font-family: Verdana; font-size: small;\"> 6.50.258<\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><span style=\"font-family: Verdana; font-size: small;\"> 6.50.281<\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><span style=\"font-family: Verdana; font-size: small;\"> 6.50.415<\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><span style=\"font-family: Verdana; font-size: small;\"> 6.50.416 <\/span><\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#c0c0c0\"><span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">SQL Server 7.0<br \/>\n(Sphinx)<\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><span style=\"font-family: Verdana; font-size: small;\"> 7.00.623<\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><span style=\"font-family: Verdana; font-size: small;\"> 7.00.699<\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><span style=\"font-family: Verdana; font-size: small;\"> 7.00.842 <\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><span style=\"font-family: Verdana; font-size: small;\"> 7.00.961<\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><span style=\"font-family: Verdana; font-size: small;\"> 7.00.1063<\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#c0c0c0\"><span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">SQL Server 2000<br \/>\n(Shiloh)<\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><span style=\"font-family: Verdana; font-size: small;\"> 8.00.194<\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><span style=\"font-family: Verdana; font-size: small;\"> 8.00.384<\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><span style=\"font-family: Verdana; font-size: small;\"> 8.00.534<\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><span style=\"font-family: Verdana; font-size: small;\"> 8.00.760<\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><span style=\"font-family: Verdana; font-size: small;\"> 8.00.2039<\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#c0c0c0\"><span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">SQL Server 2005<br \/>\n(Yukon)<\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><span style=\"font-family: Verdana; font-size: small;\"> 9.00.1399.06<\/span><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><\/td>\n<td align=\"center\" bgcolor=\"#efefef\"><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-family: Verdana; font-size: small;\">Apart from <\/span> <span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">SELECT @@VERSION<\/span><span style=\"font-family: Verdana; font-size: small;\">, there are other commands too, that show you the build number. Try, <\/span> <span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">sp_server_info<\/span><span style=\"font-family: Verdana; font-size: small;\"> and <\/span><span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">master..xp_msver<\/span><span style=\"font-family: Verdana; font-size: small;\">. In SQL Server 2000, there is a new system function called <\/span> <span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">SERVERPROPERTY<\/span><span style=\"font-family: Verdana; font-size: small;\">, that returns service pack information. Here is an example:<br \/>\n<\/span><\/p>\n<table id=\"table8\" border=\"0\" width=\"330\" cellspacing=\"0\" cellpadding=\"10\">\n<tbody>\n<tr>\n<td class=\"code\" bgcolor=\"#efefef\"><span style=\"color: #0000ff; font-family: Verdana; font-size: small;\">SELECT SERVERPROPERTY(&#8216;ProductLevel&#8217;)<br \/>\nGO<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-family: Verdana;\"><span style=\"color: #efefef;\"><strong> <span style=\"background-color: #a52a2a;\"><span style=\"font-size: small;\">What version of SQL Server 2005 do I have?<\/span><\/span><\/strong><\/span><span style=\"font-size: small;\"><br \/>\n<\/span><\/span><span style=\"font-family: Verdana; font-size: small;\">There are several different flavors of SQL Server 2005 floating around. Note that there is no longer going to be a push toward a milestone like &#8220;Beta 3,&#8221; so don&#8217;t be watching for it. Microsoft has adopted a CTP-only approach that will be in place for the remainder of the beta period. <\/span><span style=\"font-family: Verdana; font-size: small;\">As for specific build numbers, I have tried to maintain a mapping table, and while it has all of the public releases, it only shows some of the versions that were distributed to smaller audiences, such as TAP customers and other early adopters. <\/span><\/p>\n<p><span style=\"font-family: Verdana; font-size: small;\">Run the following query (which uses a CTE, for fun): <\/span><\/p>\n<table id=\"table10\" border=\"0\" width=\"529\" cellspacing=\"0\" cellpadding=\"10\">\n<tbody>\n<tr>\n<td class=\"code\" bgcolor=\"#efefef\"><span style=\"font-family: Verdana; font-size: small;\">WITH Version(ver)<br \/>\nAS<br \/>\n(<br \/>\nSELECT SUBSTRING<br \/>\n(<br \/>\n@@VERSION,<br \/>\nCHARINDEX(&#8216; &#8211; &#8216;, @@VERSION)+3,<br \/>\n32<br \/>\n)<br \/>\n)<br \/>\nSELECT Build = LEFT(ver, CHARINDEX(&#8216; &#8216;, ver))<br \/>\nFROM Version<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-family: Verdana; font-size: small;\">(Note that this query will not run on SQL Server 2000 or other previous versions.) <\/span><\/p>\n<p><span style=\"font-family: Verdana; font-size: small;\">You should see a result from this table: <\/span><\/p>\n<table id=\"table9\" border=\"0\" width=\"80%\" cellpadding=\"2\" bgcolor=\"#dedede\">\n<tbody>\n<tr bgcolor=\"#dedede\">\n<th><span style=\"font-family: Verdana; font-size: small;\">Build<\/span><\/th>\n<th><span style=\"font-family: Verdana; font-size: small;\">Explanation<\/span><\/th>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">9.00.608<\/span><\/td>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">Beta 1<\/span><\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">9.00.645<\/span><\/td>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">Internal build (???)<\/span><\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">9.00.747<\/span><\/td>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">Internal build (IDW1)<\/span><\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">9.00.767<\/span><\/td>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">Internal build (IDW2)<\/span><\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">9.00.790<\/span><\/td>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">Internal build (IDW3)<\/span><\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">9.00.823<\/span><\/td>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">Internal build (IDW4)<\/span><\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">9.00.836<\/span><\/td>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">Express Edition Technical Preview<\/span><\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">9.00.844<\/span><\/td>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">Internal build (???)<\/span><\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">9.00.849<\/span><\/td>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">Internal build (???)<\/span><\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">9.00.852<\/span><\/td>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">Beta 2<\/span><\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">9.00.917<\/span><\/td>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">Internal build (???)<\/span><\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">9.00.951<\/span><\/td>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">October CTP Release<\/span><\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">9.00.981<\/span><\/td>\n<td bgcolor=\"#ffffff\"><span style=\"font-family: Verdana; font-size: small;\">December CTP Release<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>LINKS<\/strong>:<\/p>\n<p><a href=\"http:\/\/vyaskn.tripod.com\/sqlsps.htm\"> http:\/\/vyaskn.tripod.com\/sqlsps.htm<\/a><\/p>\n<p><a href=\"http:\/\/sqlserver2000.databases.aspfaq.com\/how-do-i-know-which-version-of-sql-server-i-m-running.html\"> http:\/\/sqlserver2000.databases.aspfaq.com\/how-do-i-know-which-version-of-sql-server-i-m-running.html<\/a><\/p>\n<p><a href=\"http:\/\/support.microsoft.com\/default.aspx?scid=kb;en-us;q321185\"> http:\/\/support.microsoft.com\/default.aspx?scid=kb;en-us;q321185<\/a><\/p>\n<p><a href=\"http:\/\/www.aspfaq.com\/sql2005\/show.asp?id=20\"> http:\/\/www.aspfaq.com\/sql2005\/show.asp?id=20<\/a><\/p>\n<p><span style=\"font-family: Verdana; font-size: small;\"><br \/>\n<\/span><!--90ba539293b1e128a9ef030054ea72e9--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>2012 [sql] SELECT &#8216;SQL Server &#8216; + CAST(SERVERPROPERTY(&#8216;productversion&#8217;) AS VARCHAR) + &#8216;-&#8216; + CAST(SERVERPROPERTY(&#8216;productlevel&#8217;) AS VARCHAR) + &#8216; (&#8216; + CAST(SERVERPROPERTY(&#8216;edition&#8217;) AS VARCHAR) + &#8216;)&#8217; [\/sql] SQL Server 7.0, 2000, and 2005, running the following will extract ONLY the version information. SELECT LTRIM(RIGHT(LEFT(@@VERSION,38),9)) And the following query will work on SQL Server 2000 and up: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"close","ping_status":"close","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-191","post","type-post","status-publish","format-standard","hentry","category-sql-server","author-admin"],"_links":{"self":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=191"}],"version-history":[{"count":1,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/191\/revisions"}],"predecessor-version":[{"id":2002,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/191\/revisions\/2002"}],"wp:attachment":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=191"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}