Skip to content

Commit

Permalink
Added support for Managed Instance
Browse files Browse the repository at this point in the history
Changed EngineEdition check to include Managed Instance
Added utility sqlcmd mode file that executes all instal scripts.
  • Loading branch information
JocaPC committed Jul 20, 2018
1 parent 293c22c commit 4cdaaad
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Azure/StoredProcs/cstore_GetAlignment.sql
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ declare @SQLServerVersion nvarchar(128) = cast(SERVERPROPERTY('ProductVersion')
declare @errorMessage nvarchar(512);

-- Ensure that we are running Azure SQLDatabase
if SERVERPROPERTY('EngineEdition') <> 5
if SERVERPROPERTY('EngineEdition') NOT IN (5,8)
begin
set @errorMessage = (N'Your are not running this script on Azure SQLDatabase: Your are running a ' + @SQLServerEdition);
Throw 51000, @errorMessage, 1;
Expand Down
2 changes: 1 addition & 1 deletion Azure/StoredProcs/cstore_GetDictionaries.sql
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ declare @SQLServerVersion nvarchar(128) = cast(SERVERPROPERTY('ProductVersion')
declare @errorMessage nvarchar(512);

-- Ensure that we are running Azure SQLDatabase
if SERVERPROPERTY('EngineEdition') <> 5
if SERVERPROPERTY('EngineEdition') NOT IN (5,8)
begin
set @errorMessage = (N'Your are not running this script on Azure SQLDatabase: Your are running a ' + @SQLServerEdition);
Throw 51000, @errorMessage, 1;
Expand Down
2 changes: 1 addition & 1 deletion Azure/StoredProcs/cstore_GetFragmentation.sql
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ declare @SQLServerVersion nvarchar(128) = cast(SERVERPROPERTY('ProductVersion')
declare @errorMessage nvarchar(512);

-- Ensure that we are running Azure SQLDatabase
if SERVERPROPERTY('EngineEdition') <> 5
if SERVERPROPERTY('EngineEdition') NOT IN (5,8)
begin
set @errorMessage = (N'Your are not running this script on Azure SQLDatabase: Your are running a ' + @SQLServerEdition);
Throw 51000, @errorMessage, 1;
Expand Down
2 changes: 1 addition & 1 deletion Azure/StoredProcs/cstore_GetRowGroups.sql
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ declare @SQLServerVersion nvarchar(128) = cast(SERVERPROPERTY('ProductVersion')
declare @errorMessage nvarchar(512);

-- Ensure that we are running Azure SQLDatabase
if SERVERPROPERTY('EngineEdition') <> 5
if SERVERPROPERTY('EngineEdition') NOT IN (5,8)
begin
set @errorMessage = (N'Your are not running this script on Azure SQLDatabase: Your are running a ' + @SQLServerEdition);
Throw 51000, @errorMessage, 1;
Expand Down
2 changes: 1 addition & 1 deletion Azure/StoredProcs/cstore_GetRowGroupsDetails.sql
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ declare @SQLServerVersion nvarchar(128) = cast(SERVERPROPERTY('ProductVersion')
declare @errorMessage nvarchar(512);

-- Ensure that we are running Azure SQLDatabase
if SERVERPROPERTY('EngineEdition') <> 5
if SERVERPROPERTY('EngineEdition') NOT IN (5,8)
begin
set @errorMessage = (N'Your are not running this script on Azure SQLDatabase: Your are running a ' + @SQLServerEdition);
Throw 51000, @errorMessage, 1;
Expand Down
2 changes: 1 addition & 1 deletion Azure/StoredProcs/cstore_SuggestedTables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ declare @SQLServerVersion nvarchar(128) = cast(SERVERPROPERTY('ProductVersion')
declare @errorMessage nvarchar(512);

-- Ensure that we are running Azure SQLDatabase
if SERVERPROPERTY('EngineEdition') <> 5
if SERVERPROPERTY('EngineEdition') NOT IN (5,8)
begin
set @errorMessage = (N'Your are not running this script on Azure SQLDatabase: Your are running a ' + @SQLServerEdition);
Throw 51000, @errorMessage, 1;
Expand Down
2 changes: 1 addition & 1 deletion Azure/StoredProcs/cstore_doMaintenance.sql
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ declare @SQLServerVersion nvarchar(128) = cast(SERVERPROPERTY('ProductVersion')
declare @errorMessage nvarchar(512);

-- Ensure that we are running Azure SQLDatabase
if SERVERPROPERTY('EngineEdition') <> 5
if SERVERPROPERTY('EngineEdition') NOT IN (5,8)
begin
set @errorMessage = (N'Your are not running this script on Azure SQLDatabase: Your are running a ' + @SQLServerEdition);
Throw 51000, @errorMessage, 1;
Expand Down
16 changes: 8 additions & 8 deletions Azure/StoredProcs/cstore_install_all_stored_procs.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
CSIL - Columnstore Indexes Scripts Library for SQL Server 2016:
CSIL - Columnstore Indexes Scripts Library for Azure SQL Database:
Columnstore Alignment - Shows the alignment (ordering) between the different Columnstore Segments
Version: 1.5.0, August 2017
Expand Down Expand Up @@ -60,7 +60,7 @@ declare @SQLServerVersion nvarchar(128) = cast(SERVERPROPERTY('ProductVersion')
declare @errorMessage nvarchar(512);

-- Ensure that we are running Azure SQLDatabase
if SERVERPROPERTY('EngineEdition') <> 5
if SERVERPROPERTY('EngineEdition') NOT IN (5,8)
begin
set @errorMessage = (N'Your are not running this script on Azure SQLDatabase: Your are running a ' + @SQLServerEdition);
Throw 51000, @errorMessage, 1;
Expand Down Expand Up @@ -490,7 +490,7 @@ declare @SQLServerVersion nvarchar(128) = cast(SERVERPROPERTY('ProductVersion')
declare @errorMessage nvarchar(512);

-- Ensure that we are running Azure SQLDatabase
if SERVERPROPERTY('EngineEdition') <> 5
if SERVERPROPERTY('EngineEdition') NOT IN (5,8)
begin
set @errorMessage = (N'Your are not running this script on Azure SQLDatabase: Your are running a ' + @SQLServerEdition);
Throw 51000, @errorMessage, 1;
Expand Down Expand Up @@ -758,7 +758,7 @@ declare @SQLServerVersion nvarchar(128) = cast(SERVERPROPERTY('ProductVersion')
declare @errorMessage nvarchar(512);

-- Ensure that we are running Azure SQLDatabase
if SERVERPROPERTY('EngineEdition') <> 5
if SERVERPROPERTY('EngineEdition') NOT IN (5,8)
begin
set @errorMessage = (N'Your are not running this script on Azure SQLDatabase: Your are running a ' + @SQLServerEdition);
Throw 51000, @errorMessage, 1;
Expand Down Expand Up @@ -918,7 +918,7 @@ declare @SQLServerVersion nvarchar(128) = cast(SERVERPROPERTY('ProductVersion')
declare @errorMessage nvarchar(512);

-- Ensure that we are running Azure SQLDatabase
if SERVERPROPERTY('EngineEdition') <> 5
if SERVERPROPERTY('EngineEdition') NOT IN (5,8)
begin
set @errorMessage = (N'Your are not running this script on Azure SQLDatabase: Your are running a ' + @SQLServerEdition);
Throw 51000, @errorMessage, 1;
Expand Down Expand Up @@ -1146,7 +1146,7 @@ declare @SQLServerVersion nvarchar(128) = cast(SERVERPROPERTY('ProductVersion')
declare @errorMessage nvarchar(512);

-- Ensure that we are running Azure SQLDatabase
if SERVERPROPERTY('EngineEdition') <> 5
if SERVERPROPERTY('EngineEdition') NOT IN (5,8)
begin
set @errorMessage = (N'Your are not running this script on Azure SQLDatabase: Your are running a ' + @SQLServerEdition);
Throw 51000, @errorMessage, 1;
Expand Down Expand Up @@ -1340,7 +1340,7 @@ declare @SQLServerVersion nvarchar(128) = cast(SERVERPROPERTY('ProductVersion')
declare @errorMessage nvarchar(512);

-- Ensure that we are running Azure SQLDatabase
if SERVERPROPERTY('EngineEdition') <> 5
if SERVERPROPERTY('EngineEdition') NOT IN (5,8)
begin
set @errorMessage = (N'Your are not running this script on Azure SQLDatabase: Your are running a ' + @SQLServerEdition);
Throw 51000, @errorMessage, 1;
Expand Down Expand Up @@ -1854,7 +1854,7 @@ declare @SQLServerVersion nvarchar(128) = cast(SERVERPROPERTY('ProductVersion')
declare @errorMessage nvarchar(512);

-- Ensure that we are running Azure SQLDatabase
if SERVERPROPERTY('EngineEdition') <> 5
if SERVERPROPERTY('EngineEdition') NOT IN (5,8)
begin
set @errorMessage = (N'Your are not running this script on Azure SQLDatabase: Your are running a ' + @SQLServerEdition);
Throw 51000, @errorMessage, 1;
Expand Down
19 changes: 19 additions & 0 deletions Azure/StoredProcs/cstore_install_all_stored_procs_cmd.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-- IMPORTANT: Swith to SQLCMD mode using Query/SQLCMD Mode in SSMS menu!

-- Set the path where *.sql files are placed
-- (e.g. the current folder where this file is placed)
:setvar path "C:\GitHub\CISL\Azure\StoredProcs\"

:r $(path)cstore_GetRowGroups.sql
:r $(path)cstore_GetRowGroupsDetails.sql
:r $(path)cstore_GetAlignment.sql
:r $(path)cstore_GetDictionaries.sql
:r $(path)cstore_GetFragmentation.sql
:r $(path)cstore_SuggestedTables.sql
:r $(path)cstore_doMaintenance.sql

/*
To cleanup:
:setvar path "C:\GitHub\CISL\Azure\StoredProcs\"
:r $(path)cstore_cleanup.sql
*/

0 comments on commit 4cdaaad

Please sign in to comment.