Skip to content

Commit 0433af0

Browse files
Minor update for Azure SQL DB
1 parent 90b0a41 commit 0433af0

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

RightsManagement/sp_CloneRights.sql

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
1+
/* *****************************************************************************************
2+
AZURE SQL DB Notice
3+
4+
Comment-out the unsupported USE [master] when running in Azure SQL DB/Synapse Analytics
5+
or ignore error caused by unsupported USE statement
6+
******************************************************************************************** */
17
USE [master]
28
GO
9+
10+
311
IF NOT EXISTS (SELECT 1 FROM sys.all_objects WHERE object_id = OBJECT_ID('[dbo].[sp_CloneRights]') AND TYPE = 'P')
412
EXECUTE ('CREATE PROCEDURE [dbo].[sp_CloneRights] AS BEGIN PRINT ''Container for sp_CloneRights (C) Pavel Pawlowski'' END');
513
GO
614
/* ****************************************************
7-
sp_CloneRights v0.40 (2017-11-14)
15+
sp_CloneRights v0.41 (2020-10-22)
816
917
Feedback: mailto:pavel.pawlowski@hotmail.cz
1018
1119
MIT License
1220
13-
Copyright (c) 2017 Pavel Pawlowski
21+
Copyright (c) 2020 Pavel Pawlowski
1422
1523
Permission is hereby granted, free of charge, to any person obtaining a copy
1624
of this software and associated documentation files (the "Software"), to deal
@@ -104,7 +112,7 @@ CREATE TABLE #output (
104112

105113

106114
--Set and print the procedure output caption
107-
RAISERROR(N'PRINT ''sp_CloneRights v0.40 (2017-11-14) (C) 2010-2017 Pavel Pawlowski''', 0, 0) WITH NOWAIT;
115+
RAISERROR(N'PRINT ''sp_CloneRights v0.41 (2020-10-22) (C) 2010-2020 Pavel Pawlowski''', 0, 0) WITH NOWAIT;
108116
RAISERROR(N'PRINT ''===============================================================''', 0, 0) WITH NOWAIT;
109117

110118
INSERT INTO @allowedClasses(ClassName, ClassDescription)
@@ -1170,5 +1178,6 @@ END
11701178
GO
11711179

11721180
--Mark Stored Procedure as system object, so it executes in the context of current database.
1173-
EXECUTE sp_ms_marksystemobject 'dbo.sp_CloneRights'
1181+
IF SERVERPROPERTY('EngineEdition') IN (1, 2, 3, 4, 8)
1182+
EXEC(N'EXECUTE sp_ms_marksystemobject ''dbo.sp_CloneRights''');
11741183
GO

0 commit comments

Comments
 (0)