|
| 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 | +******************************************************************************************** */ |
1 | 7 | USE [master] |
2 | 8 | GO |
| 9 | + |
| 10 | + |
3 | 11 | IF NOT EXISTS (SELECT 1 FROM sys.all_objects WHERE object_id = OBJECT_ID('[dbo].[sp_CloneRights]') AND TYPE = 'P') |
4 | 12 | EXECUTE ('CREATE PROCEDURE [dbo].[sp_CloneRights] AS BEGIN PRINT ''Container for sp_CloneRights (C) Pavel Pawlowski'' END'); |
5 | 13 | GO |
6 | 14 | /* **************************************************** |
7 | | -sp_CloneRights v0.40 (2017-11-14) |
| 15 | +sp_CloneRights v0.41 (2020-10-22) |
8 | 16 |
|
9 | 17 | Feedback: mailto:pavel.pawlowski@hotmail.cz |
10 | 18 |
|
11 | 19 | MIT License |
12 | 20 |
|
13 | | -Copyright (c) 2017 Pavel Pawlowski |
| 21 | +Copyright (c) 2020 Pavel Pawlowski |
14 | 22 |
|
15 | 23 | Permission is hereby granted, free of charge, to any person obtaining a copy |
16 | 24 | of this software and associated documentation files (the "Software"), to deal |
@@ -104,7 +112,7 @@ CREATE TABLE #output ( |
104 | 112 |
|
105 | 113 |
|
106 | 114 | --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; |
108 | 116 | RAISERROR(N'PRINT ''===============================================================''', 0, 0) WITH NOWAIT; |
109 | 117 |
|
110 | 118 | INSERT INTO @allowedClasses(ClassName, ClassDescription) |
@@ -1170,5 +1178,6 @@ END |
1170 | 1178 | GO |
1171 | 1179 |
|
1172 | 1180 | --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'''); |
1174 | 1183 | GO |
0 commit comments