How to get SqlServerBuilds data programmatically?

All SQL Server builds are available in a public Google Sheet here:

https://docs.google.com/spreadsheets/d/16Ymdz80xlCzb6CwRFVokwo0onkofVYFoSkc7mYe6pgw/view

Google Sheet can be downloaded in these formats:


It can also be downloaded using a program via API:

Using Microsoft PowerShell / curl / wget:

Example 1: All SQL Server builds
Example 2: RTM + all Cumulative Updates for SQL Server
Example 3: All supported SQL Server releases
Using T-SQL:

Example 4: All SQL Server builds
Example 5: All SQL Server releases
Known error messages (PowerShell):

The response content cannot be parsed because the Internet Explorer engine is not available, or Internet Explorer's first-launch configuration is not complete.

Example 1: All SQL Server 2017 builds (PowerShell / curl / wget)

File Download.ps1:

Add-Type -Assembly System.Web # [System.Web.HttpUtility]::UrlEncode() needs this

$SqlVersion = "2017"
$Query = "select * where A='" + $SqlVersion + "'"
$URL   = "https://docs.google.com/spreadsheets/d/16Ymdz80xlCzb6CwRFVokwo0onkofVYFoSkc7mYe6pgw/gviz/tq?tq=" `
       + [System.Web.HttpUtility]::UrlEncode($Query) `
       + "&tqx=out:csv"

Invoke-WebRequest $URL -OutFile "C:\Temp\SqlServerBuilds.csv"

Run:

PowerShell.exe -ExecutionPolicy Unrestricted .\Download.ps1

Typical result – content of the file SqlServerBuilds.csv:

"SQLServer","Version","Build","FileVersion","Description","Link","ReleaseDate","SP","CU","HF","RTM","CTP","New"
"2017","14","14.0.3238.1","2017.140.3238.1","Cumulative update 17 (CU17) for SQL Server 2017","https://support.microsoft.com/en-us/help/4515579","2019-10-08","","TRUE","","","",""
"2017","14","14.0.3223.3","2017.140.3223.3","Cumulative update 16 (CU16) for SQL Server 2017","https://support.microsoft.com/en-us/help/4508218","2019-08-01","","TRUE","","","",""
"2017","14","14.0.3208.1","2017.140.3208.1","On-demand hotfix update package 2 for SQL Server 2017 Cumulative update 15 (CU15)","https://support.microsoft.com/en-us/help/4510083","2019-07-09","","","TRUE","","",""
"2017","14","14.0.3192.2","2017.140.3192.2","Security update for SQL Server 2017 CU15 GDR: July 9, 2019","https://support.microsoft.com/en-us/help/4505225","2019-07-09","","","","","",""
"2017","14","14.0.3164.1","2017.140.3164.1","On-demand hotfix update package for SQL Server 2017 Cumulative update 15 (CU15)","https://support.microsoft.com/en-us/help/4506633","2019-06-20","","","TRUE","","",""
"2017","14","14.0.3162.1","2017.140.3162.1","Cumulative update 15 (CU15) for SQL Server 2017","https://support.microsoft.com/en-us/help/4498951","2019-05-24","","TRUE","","","",""
"2017","14","14.0.3103.1","2017.140.3103.1","Security update for SQL Server 2017 Cumulative update 14 (CU14): May 14, 2019","https://support.microsoft.com/en-us/help/4494352","2019-05-14","","","","","",""
"2017","14","14.0.3076.1","2017.140.3076.1","Cumulative update 14 (CU14) for SQL Server 2017","https://support.microsoft.com/en-us/help/4484710","2019-03-25","","TRUE","","","",""
"2017","14","14.0.3049.1","2017.140.3049.1","On-demand hotfix update package for SQL Server 2017 Cumulative update 13 (CU13)","https://support.microsoft.com/en-us/help/4483666","2019-01-08","","","TRUE","","",""
"2017","14","14.0.3048.4","2017.140.3048.4","Cumulative update 13 (CU13) for SQL Server 2017","https://support.microsoft.com/en-us/help/4466404","2018-12-18","","TRUE","","","",""
...


The same can be achieved with a "one-liner" using the curl utility, which is included with Windows 10 and higher – file Download.cmd:

curl https://docs.google.com/spreadsheets/d/16Ymdz80xlCzb6CwRFVokwo0onkofVYFoSkc7mYe6pgw/gviz/tq?tq=select+*+where+A='2017'^&tqx=out:csv -o "C:\Temp\SqlServerBuilds.csv"

Or using the wget utility – file Download.cmd:

wget https://docs.google.com/spreadsheets/d/16Ymdz80xlCzb6CwRFVokwo0onkofVYFoSkc7mYe6pgw/gviz/tq?tq=select+*+where+A='2017'^&tqx=out:csv -O "C:\Temp\SqlServerBuilds.csv"

Example 2: RTM + all Cumulative Updates (CUs) for SQL Server 2017 (PowerShell)

File Download.ps1:

Add-Type -Assembly System.Web # [System.Web.HttpUtility]::UrlEncode() needs this

$Query = "select C,E,F,G where A='2017' and (I=TRUE or K=TRUE)"
$URL   = "https://docs.google.com/spreadsheets/d/16Ymdz80xlCzb6CwRFVokwo0onkofVYFoSkc7mYe6pgw/gviz/tq?tq=" `
       + [System.Web.HttpUtility]::UrlEncode($Query) `
       + "&tqx=out:csv"

Invoke-WebRequest $URL -OutFile "C:\Temp\SqlServerBuilds.csv"

Run:

PowerShell.exe -ExecutionPolicy Unrestricted .\Download.ps1

Typical result – content of the file SqlServerBuilds.csv:

"Build","Description","Link","ReleaseDate"
"14.0.3238.1","Cumulative update 17 (CU17) for SQL Server 2017","https://support.microsoft.com/en-us/help/4515579","2019-10-08"
"14.0.3223.3","Cumulative update 16 (CU16) for SQL Server 2017","https://support.microsoft.com/en-us/help/4508218","2019-08-01"
"14.0.3162.1","Cumulative update 15 (CU15) for SQL Server 2017","https://support.microsoft.com/en-us/help/4498951","2019-05-24"
"14.0.3076.1","Cumulative update 14 (CU14) for SQL Server 2017","https://support.microsoft.com/en-us/help/4484710","2019-03-25"
"14.0.3048.4","Cumulative update 13 (CU13) for SQL Server 2017","https://support.microsoft.com/en-us/help/4466404","2018-12-18"
"14.0.3045.24","Cumulative update 12 (CU12) for SQL Server 2017","https://support.microsoft.com/en-us/help/4464082","2018-10-24"
"14.0.3038.14","Cumulative update 11 (CU11) for SQL Server 2017","https://support.microsoft.com/en-us/help/4462262","2018-09-21"
"14.0.3037.1","Cumulative update 10 (CU10) for SQL Server 2017","https://support.microsoft.com/en-us/help/4342123","2018-08-27"
"14.0.3030.27","Cumulative update 9 (CU9) for SQL Server 2017","https://support.microsoft.com/en-us/help/4341265","2018-07-18"
"14.0.3029.16","Cumulative update 8 (CU8) for SQL Server 2017","https://support.microsoft.com/en-us/help/4338363","2018-06-21"
"14.0.3026.27","Cumulative update 7 (CU7) for SQL Server 2017","https://support.microsoft.com/en-us/help/4229789","2018-05-23"
"14.0.3025.34","Cumulative update 6 (CU6) for SQL Server 2017","https://support.microsoft.com/en-us/help/4101464","2018-04-19"
"14.0.3023.8","Cumulative update 5 (CU5) for SQL Server 2017","https://support.microsoft.com/en-us/help/4092643","2018-03-20"
"14.0.3022.28","Cumulative update 4 (CU4) for SQL Server 2017","https://support.microsoft.com/en-us/help/4056498","2018-02-17"
"14.0.3015.40","Cumulative update 3 (CU3) for SQL Server 2017","https://support.microsoft.com/en-us/help/4052987","2018-01-04"
"14.0.3008.27","Cumulative update 2 (CU2) for SQL Server 2017","https://support.microsoft.com/en-us/help/4052574","2017-11-28"
"14.0.3006.16","Cumulative update 1 (CU1) for SQL Server 2017","https://support.microsoft.com/en-us/help/4038634","2017-10-23"
"14.0.1000.169","Microsoft SQL Server 2017 RTM","https://www.microsoft.com/en-us/sql-server/sql-server-downloads","2017-10-02"

Example 3: All supported SQL Server releases (PowerShell)

File Download.ps1:

Add-Type -Assembly System.Web # [System.Web.HttpUtility]::UrlEncode() needs this

$Query = "select * where J<>TRUE"
$URL   = "https://docs.google.com/spreadsheets/d/16Ymdz80xlCzb6CwRFVokwo0onkofVYFoSkc7mYe6pgw/gviz/tq?gid=1648964847&tq=" `
       + [System.Web.HttpUtility]::UrlEncode($Query) `
       + "&tqx=out:csv"

Invoke-WebRequest $URL -OutFile "C:\Temp\SqlServerReleases.csv"

Run:

PowerShell.exe -ExecutionPolicy Unrestricted .\Download.ps1

Typical result – content of the file SqlServerReleases.csv:

"Release","FullName","Version","DatabaseCompatibilityLevel","InternalDatabaseVersion","ReleaseDate","MainstreamSupportEnds","ExtendedSupportEnds","IsLatest","IsObsolete","IsBeta"
"2019","SQL Server 2019","15.0","150","904","2019-11-04","2025-01-07","2030-01-08","TRUE","",""
"2017","SQL Server 2017","14.0","140","869","2017-10-02","2022-10-11","2027-10-12","","",""
"2016","SQL Server 2016","13.0","130","852","2016-06-01","2021-07-13","2026-07-14","","",""
"2014","SQL Server 2014","12.0","120","782","2014-04-01","2019-07-09","2024-07-09","","",""
"2012","SQL Server 2012","11.0","110","706","2012-03-06","2017-07-11","2022-07-12","","",""

Example 4: All SQL Server builds (T-SQL)

Prerequisite:

-- First you need to have the "Ole Automation Procedures" configuration enabled on SQL Server.
-- Please note that this is not recommended on the production server!
EXEC sp_configure N'show advanced options', 1;
RECONFIGURE;

EXEC sp_configure N'Ole Automation Procedures', 1;
RECONFIGURE;

T-SQL script:

-- Warning: too many web requests may be limited by Google Docs! Use wisely.
SET NOCOUNT ON;
DECLARE @Url NVARCHAR(2048) = N'https://docs.google.com/spreadsheets/d/16Ymdz80xlCzb6CwRFVokwo0onkofVYFoSkc7mYe6pgw/gviz/tq?tqx=out:json';
DECLARE @obj INT, @hr INT, @status INT;
DECLARE @Response TABLE(ResponseText NVARCHAR(MAX) NULL);

EXEC @hr = sp_OACreate 'MSXML2.XMLHTTP', @obj OUT;
IF ISNULL(@hr, 0) <> 0       THROW 50000, 'sp_OACreate error', 0;
IF @obj IS NULL              THROW 50000, 'sp_OACreate error', 1;

EXEC @hr = sp_OAMethod @obj, 'open', NULL, 'GET', @Url, False;
IF ISNULL(@hr, 0) <> 0       THROW 50000, 'sp_OAMethod open() error', 0;

EXEC @hr = sp_OAMethod @obj, 'send';
IF ISNULL(@hr, 0) <> 0       THROW 50000, 'sp_OAMethod send() error', 0;

EXEC @hr = sp_OAGetProperty @obj, 'status', @status OUT;
IF ISNULL(@hr, 0)     <>   0 THROW 50000, 'sp_OAGetProperty status error', 0;
IF ISNULL(@status, 0) <> 200 THROW 50000, 'sp_OAGetProperty status error', 1;

INSERT INTO @Response(ResponseText)
EXEC @hr = sp_OAGetProperty @obj, 'responseText';
IF ISNULL(@hr, 0) <> 0       THROW 50000, 'sp_OAGetProperty responseText error', 0;

EXEC @hr = sp_OADestroy @obj;
IF ISNULL(@hr, 0) <> 0       THROW 50000, 'sp_OADestroy error', 0;

DECLARE @JsonP NVARCHAR(MAX) = (SELECT ResponseText FROM @Response);
IF ISNULL(@JsonP, N'') = N'' THROW 50000, 'Empty response', 0;

-- Now we have JSON-P and we need to clear the text at the beginning '/*O_o*/<NewLine>google.visualization.Query.setResponse(' and end ');'.
DECLARE @Json NVARCHAR(MAX) = SUBSTRING(@JsonP, 48, DATALENGTH(@JsonP) - 48 - 1);

-- Transform JSON into a table-like dataset
SELECT *
FROM OPENJSON(@Json, '$.table.rows')
WITH (
  SQLServer   NVARCHAR(MAX) '$.c[0].v',
  Version     NVARCHAR(MAX) '$.c[1].v',
  Build       NVARCHAR(MAX) '$.c[2].v',
  FileVersion NVARCHAR(MAX) '$.c[3].v',
  Description NVARCHAR(MAX) '$.c[4].v',
  Link        NVARCHAR(MAX) '$.c[5].v',
  ReleaseDate DATE          '$.c[6].f',
  SP          BIT           '$.c[7].v',
  CU          BIT           '$.c[8].v',
  HF          BIT           '$.c[9].v',
  RTM         BIT           '$.c[10].v',
  CTP         BIT           '$.c[11].v',
  New         BIT           '$.c[12].v',
  Withdrawn   BIT           '$.c[13].v'
);

Typical result:

SQLServer Version Build        FileVersion      Description                                               Link                                                       ReleaseDate SP   CU   HF   RTM  CTP  New  Withdrawn
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2019      15.0    15.0.4178.1  2019.150.4178.1  Cumulative update 13 (CU13) for SQL Server 2019           https://support.microsoft.com/en-us/help/5005679           2021-10-05  NULL 1    NULL NULL NULL 1    NULL
2019      15.0    15.0.4153.1  2019.150.4153.1  Cumulative update 12 (CU12) for SQL Server 2019           https://support.microsoft.com/en-us/help/5004524           2021-08-04  NULL 1    NULL NULL NULL NULL NULL
2019      15.0    15.0.4138.2  2019.150.4138.2  Cumulative update 11 (CU11) for SQL Server 2019           https://support.microsoft.com/en-us/help/5003249           2021-06-10  NULL 1    NULL NULL NULL NULL NULL
2019      15.0    15.0.4123.1  2019.150.4123.1  Cumulative update 10 (CU10) for SQL Server 2019           https://support.microsoft.com/en-us/help/5001090           2021-04-06  NULL 1    NULL NULL NULL NULL NULL
2019      15.0    15.0.4102.2  2019.150.4102.2  Cumulative update 9 (CU9) for SQL Server 2019             https://support.microsoft.com/en-us/help/5000642           2021-02-11  NULL 1    NULL NULL NULL NULL NULL
2019      15.0    15.0.4083.2  2019.150.4083.2  Security update for SQL Server 2019 CU8: January 12, 2021 https://support.microsoft.com/en-us/help/4583459           2021-01-12  NULL NULL NULL NULL NULL NULL NULL
2019      15.0    15.0.4073.23 2019.150.4073.23 Cumulative update 8 (CU8) for SQL Server 2019             https://support.microsoft.com/en-us/help/4577194           2020-10-01  NULL 1    NULL NULL NULL NULL NULL
2019      15.0    15.0.4063.15 2019.150.4063.15 Cumulative update 7 (CU7) for SQL Server 2019             https://support.microsoft.com/en-us/help/4570012           2020-09-02  NULL 1    NULL NULL NULL NULL 1
2019      15.0    15.0.4053.23 2019.150.4053.23 Cumulative update 6 (CU6) for SQL Server 2019             https://support.microsoft.com/en-us/help/4563110           2020-08-04  NULL 1    NULL NULL NULL NULL NULL
2019      15.0    15.0.4043.16 2019.150.4043.16 Cumulative update 5 (CU5) for SQL Server 2019             https://support.microsoft.com/en-us/help/4552255           2020-06-22  NULL 1    NULL NULL NULL NULL NULL
2019      15.0    15.0.4033.1  2019.150.4033.1  Cumulative update 4 (CU4) for SQL Server 2019             https://support.microsoft.com/en-us/help/4548597           2020-03-31  NULL 1    NULL NULL NULL NULL NULL
2019      15.0    15.0.4023.6  2019.150.4023.6  Cumulative update 3 (CU3) for SQL Server 2019             https://support.microsoft.com/en-us/help/4538853           2020-03-12  NULL 1    NULL NULL NULL NULL NULL
2019      15.0    15.0.4013.40 2019.150.4013.40 Cumulative update 2 (CU2) for SQL Server 2019             https://support.microsoft.com/en-us/help/4536075           2020-02-13  NULL 1    NULL NULL NULL NULL 1
2019      15.0    15.0.4003.23 2019.150.4003.23 Cumulative update 1 (CU1) for SQL Server 2019             https://support.microsoft.com/en-us/help/4527376           2020-01-07  NULL 1    NULL NULL NULL NULL NULL
2019      15.0    15.0.2080.9  2019.150.2080.9  Security update for SQL Server 2019 GDR: January 12, 2021 https://support.microsoft.com/en-us/help/4583458           2021-01-12  NULL NULL NULL NULL NULL NULL NULL
2019      15.0    15.0.2070.41 2019.150.2070.41 Servicing Update (GDR1) for SQL Server 2019 RTM           https://support.microsoft.com/en-us/help/4517790           2019-11-04  NULL NULL NULL NULL NULL NULL NULL
2019      15.0    15.0.2000.5  2019.150.2000.5  Microsoft SQL Server 2019 RTM                             https://www.microsoft.com/en-us/sql-server/sql-server-2019 2019-11-04  NULL NULL NULL 1    NULL NULL NULL
...

Example 5: All SQL Server releases (T-SQL)

Prerequisite:

-- First you need to have the "Ole Automation Procedures" configuration enabled on SQL Server.
-- Please note that this is not recommended on the production server!
EXEC sp_configure N'show advanced options', 1;
RECONFIGURE;

EXEC sp_configure N'Ole Automation Procedures', 1;
RECONFIGURE;

T-SQL script:

-- Warning: too many web requests may be limited by Google Docs! Use wisely.
SET NOCOUNT ON;
DECLARE @Url NVARCHAR(2048) = N'https://docs.google.com/spreadsheets/d/16Ymdz80xlCzb6CwRFVokwo0onkofVYFoSkc7mYe6pgw/gviz/tq?gid=1648964847&tqx=out:json';
DECLARE @obj INT, @hr INT, @status INT;
DECLARE @Response TABLE(ResponseText NVARCHAR(MAX) NULL);

EXEC @hr = sp_OACreate 'MSXML2.XMLHTTP', @obj OUT;
IF ISNULL(@hr, 0) <> 0       THROW 50000, 'sp_OACreate error', 0;
IF @obj IS NULL              THROW 50000, 'sp_OACreate error', 1;

EXEC @hr = sp_OAMethod @obj, 'open', NULL, 'GET', @Url, False;
IF ISNULL(@hr, 0) <> 0       THROW 50000, 'sp_OAMethod open() error', 0;

EXEC @hr = sp_OAMethod @obj, 'send';
IF ISNULL(@hr, 0) <> 0       THROW 50000, 'sp_OAMethod send() error', 0;

EXEC @hr = sp_OAGetProperty @obj, 'status', @status OUT;
IF ISNULL(@hr, 0)     <>   0 THROW 50000, 'sp_OAGetProperty status error', 0;
IF ISNULL(@status, 0) <> 200 THROW 50000, 'sp_OAGetProperty status error', 1;

INSERT INTO @Response(ResponseText)
EXEC @hr = sp_OAGetProperty @obj, 'responseText';
IF ISNULL(@hr, 0) <> 0       THROW 50000, 'sp_OAGetProperty responseText error', 0;

EXEC @hr = sp_OADestroy @obj;
IF ISNULL(@hr, 0) <> 0       THROW 50000, 'sp_OADestroy error', 0;

DECLARE @JsonP NVARCHAR(MAX) = (SELECT ResponseText FROM @Response);
IF ISNULL(@JsonP, N'') = N'' THROW 50000, 'Empty response', 0;

-- Now we have JSON-P and we need to clear the text at the beginning '/*O_o*/<NewLine>google.visualization.Query.setResponse(' and end ');'.
DECLARE @Json NVARCHAR(MAX) = SUBSTRING(@JsonP, 48, DATALENGTH(@JsonP) - 48 - 1);

-- Transform JSON into a table-like dataset
SELECT *
FROM OPENJSON(@Json, '$.table.rows')
WITH (
  Release                    NVARCHAR(MAX) '$.c[0].v',
  FullName                   NVARCHAR(MAX) '$.c[1].v',
  Version                    NVARCHAR(MAX) '$.c[2].v',
  DatabaseCompatibilityLevel NVARCHAR(MAX) '$.c[3].f',
  InternalDatabaseVersion    NVARCHAR(MAX) '$.c[4].f',
  ReleaseDate                DATE          '$.c[5].f',
  MainstreamSupportEnds      DATE          '$.c[6].f',
  ExtendedSupportEnds        DATE          '$.c[7].f',
  IsLatest                   BIT           '$.c[8].v',
  IsObsolete                 BIT           '$.c[9].v',
  IsBeta                     BIT           '$.c[10].v'
);

Typical result:

Release FullName           Version DatabaseCompatibilityLevel InternalDatabaseVersion    ReleaseDate MainstreamSupportEnds ExtendedSupportEnds IsLatest IsObsolete IsBeta
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2022    SQL Server 2022    16.0    160                        NULL                       NULL        NULL                  NULL                NULL     NULL       1
2019    SQL Server 2019    15.0    150                        904                        2019-11-04  2025-01-07            2030-01-08          1        NULL       NULL
2017    SQL Server 2017    14.0    140                        869                        2017-10-02  2022-10-11            2027-10-12          NULL     NULL       NULL
2016    SQL Server 2016    13.0    130                        852                        2016-06-01  2021-07-13            2026-07-14          NULL     NULL       NULL
2014    SQL Server 2014    12.0    120                        782                        2014-04-01  2019-07-09            2024-07-09          NULL     NULL       NULL
2012    SQL Server 2012    11.0    110                        706                        2012-03-06  2017-07-11            2022-07-12          NULL     NULL       NULL
2008 R2 SQL Server 2008 R2 10.50   100                        660                        2010-04-21  2014-07-08            2019-07-09          NULL     1          NULL
2008    SQL Server 2008    10.0    100                        655                        2008-08-07  2014-07-08            2019-07-09          NULL     1          NULL
2005    SQL Server 2005    9.0     90                         611                        2005-11-07  2011-04-12            2016-04-12          NULL     1          NULL
2000    SQL Server 2000    8.0     80                         539                        2000-11-30  2008-04-08            2013-04-09          NULL     1          NULL
7.0     SQL Server 7.0     7.0     70                         515                        1998-11-27  2005-12-31            2011-01-11          NULL     1          NULL
6.5     SQL Server 6.5     6.5     60                         408                        1996-06-30  2002-01-01            NULL                NULL     1          NULL
6.0     SQL Server 6.0     6.0     60                         406                        1995-06-13  1999-03-31            NULL                NULL     1          NULL

Known error messages (PowerShell)

The response content cannot be parsed because the Internet Explorer engine is not available, or Internet Explorer's first-launch configuration is not complete.

On older versions of PowerShell (< 6.0), you need to use the -UseBasicParsing parameter:

Invoke-WebRequest $URL -UseBasicParsing -OutFile "C:\Temp\SqlServerBuilds.csv"

Based on:

 

 

© 2007–2024 SqlServerBuilds.blogspot.com · Contact · Privacy policy


Other useful sites › SQL Server Versions List · Firebird Database Versions List · Exchange Server Versions List · SharePoint Servers Version List · Microsoft Knowledge Base Monitoring