You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/relational-databases/databases/database-snapshots-sql-server.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -131,7 +131,7 @@ A database snapshot is a read-only, static view of a [!INCLUDE[ssNoVersion](../.
131
131
132
132
- The source database cannot be configured as a scalable shared database.
133
133
134
-
-The source database must not contain a MEMORY_OPTIMIZED_DATA filegroup. For more information, see [Unsupported SQL Server Features for In-Memory OLTP](../../relational-databases/in-memory-oltp/unsupported-sql-server-features-for-in-memory-oltp.md).
134
+
-Prior to SQL Server 2019, the source database could not contain a MEMORY_OPTIMIZED_DATA filegroup. Support for in-memory database snapshots was added in SQL Server 2019.
Copy file name to clipboardExpand all lines: docs/t-sql/statements/add-signature-transact-sql.md
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,7 +78,7 @@ The module being signed or countersigned and the certificate or asymmetric key u
78
78
> [!CAUTION]
79
79
> Module signing should only be used to grant permissions, never to deny or revoke permissions.
80
80
81
-
Ddata definition language (DDL) triggers and Inline table-valued functions cannot be signed.
81
+
Data definition language (DDL) triggers and Inline table-valued functions cannot be signed.
82
82
83
83
Information about signatures is visible in the sys.crypt_properties catalog view.
84
84
@@ -88,15 +88,15 @@ The module being signed or countersigned and the certificate or asymmetric key u
88
88
## Countersignatures
89
89
When executing a signed module, the signatures will be temporarily added to the SQL token, but the signatures are lost if the module executes another module or if the module terminates execution. A countersignature is a special form of signature. By itself, a countersignature doesn't grant any permissions, however, it allows signatures made by the same certificate or asymmetric key to be kept for the duration of the call made to the countersigned object.
90
90
91
-
For example, presume that user Alice calls procedure ProcSelectT1ForAlice, which calls procedure procSelectT1, which selects from table T1. Alice has EXECUTE permission on ProcSelectT1ForAlice and procSelectT1, but she doesn't have SELECT permission on T1, and no ownership chaining is involved in this entire chain. Alice cannot access table T1, either directly, or through the use of ProcSelectT1ForAlice and procSelectT1. Since we want Alice to always use ProcSelectT1ForAlice for access, we don't want to grant her permission to execute procSelectT1. How can we accomplish this?
91
+
For example, presume that user Alice calls procedure ProcForAlice, which calls procedure ProcSelectT1, which selects from table T1. Alice has EXECUTE permission on ProcForAlice and ProcSelectT1, but she doesn't have SELECT permission on T1, and no ownership chaining is involved in this entire chain. Alice cannot access table T1, either directly, or through the use of ProcForAlice and ProcSelectT1. Since we want Alice to always use ProcForAlice for access, we don't want to grant her permission to execute ProcSelectT1. How can we accomplish this?
92
92
93
-
- If we sign procSelectT1, such that procSelectT1 can access T1, then Alice can invoke procSelectT1 directly and she doesn't have to call ProcSelectT1ForAlice.
93
+
- If we sign ProcSelectT1, such that ProcSelectT1 can access T1, then Alice can invoke ProcSelectT1 directly and she doesn't have to call ProcForAlice.
94
94
95
-
- We could deny EXECUTE permission on procSelectT1 to Alice, but then Alice would not be able to call procSelectT1 through ProcSelectT1ForAlice.
95
+
- We could deny EXECUTE permission on ProcSelectT1 to Alice, but then Alice would not be able to call ProcSelectT1 through ProcForAlice.
96
96
97
-
- Signing ProcSelectT1ForAlice would not work by itself, because the signature would be lost in the call to procSelectT1.
97
+
- Signing ProcForAlice would not work by itself, because the signature would be lost in the call to ProcSelectT1.
98
98
99
-
However, by countersigning procSelectT1 with the same certificate used to sign ProcSelectT1ForAlice, [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]will keep the signature across the call chain and will allow access to T1. If Alice attempts to call procSelectT1 directly, she cannot access T1, because the countersignature doesn't grant any rights. Example C below, shows the [!INCLUDE[tsql](../../includes/tsql-md.md)] for this example.
99
+
However, by countersigning ProcSelectT1 with the same certificate used to sign ProcForAlice, [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] the signature will be kept across the call chain and will allow access to T1. If Alice attempts to call ProcSelectT1 directly, she cannot access T1, because the countersignature doesn't grant any rights. Example C below, shows the [!INCLUDE[tsql](../../includes/tsql-md.md)] for this example.
100
100
101
101
## Permissions
102
102
@@ -206,42 +206,42 @@ BEGIN
206
206
SELECT*FROM T1;
207
207
END;
208
208
GO
209
-
GRANT EXECUTE ONprocSelectT1 to public;
209
+
GRANT EXECUTE ONProcSelectT1 to public;
210
210
211
211
-- Create special procedure for accessing T1
212
-
CREATE PROCEDURE procSelectT1ForAliceAS
212
+
CREATE PROCEDURE ProcForAliceAS
213
213
BEGIN
214
214
IF USER_ID() <> USER_ID('Alice')
215
215
BEGIN
216
216
PRINT 'Only Alice can use this.';
217
217
RETURN
218
218
END
219
-
EXEC procSelectT1;
219
+
EXEC ProcSelectT1;
220
220
END;
221
221
GO;
222
-
GRANT EXECUTE ONprocSelectT1ForAlice TO PUBLIC;
222
+
GRANT EXECUTE ONProcForAlice TO PUBLIC;
223
223
224
224
-- Verify procedure works for a sysadmin user
225
-
EXEC procSelectT1ForAlice;
225
+
EXEC ProcForAlice;
226
226
227
227
-- Alice still can't use the procedure yet
228
228
EXECUTE AS LOGIN ='Alice';
229
-
EXEC procSelectT1ForAlice;
229
+
EXEC ProcForAlice;
230
230
REVERT;
231
231
232
232
-- Sign procedure to grant it SELECT permission
233
-
ADD SIGNATURE TO procSelectT1ForAlice BY CERTIFICATE csSelectT
233
+
ADD SIGNATURE TO ProcForAlice BY CERTIFICATE csSelectT
234
234
WITH PASSWORD ='SimplePwd01';
235
235
236
-
-- Counter sign proc_select_t, to make this work
237
-
ADD COUNTER SIGNATURE TO procSelectT1 BY CERTIFICATE csSelectT
236
+
-- Counter sign ProcSelectT1, to make this work
237
+
ADD COUNTER SIGNATURE TO ProcSelectT1 BY CERTIFICATE csSelectT
238
238
WITH PASSWORD ='SimplePwd01';
239
239
240
240
-- Now the proc works.
241
-
-- Note that calling procSelectT1 directly still doesn't work
241
+
-- Note that calling ProcSelectT1 directly still doesn't work
0 commit comments