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
| FULLTEXT STOPLIST | MESSAGE TYPE | REMOTE SERVICE BINDING
54
+
| ROLE | ROUTE | SCHEMA | SEARCH PROPERTY LIST | SERVER ROLE
55
+
| SERVICE | SYMMETRIC KEY | XML SCHEMA COLLECTION
57
56
}
58
57
```
59
58
@@ -91,7 +90,7 @@ ALTER AUTHORIZATION ON
91
90
92
91
<entity_name> ::=
93
92
{
94
-
schema_name
93
+
schema_name
95
94
| [ schema_name. ] object_name
96
95
}
97
96
```
@@ -232,18 +231,15 @@ Azure AD user |Azure AD user |Success
232
231
To verify an Azure AD owner of the database execute the following Transact-SQL command in a user database (in this example `testdb`).
233
232
234
233
```
235
-
236
234
SELECT CAST(owner_sid as uniqueidentifier) AS Owner_SID
237
235
FROM sys.databases
238
236
WHERE name = 'testdb';
239
-
240
237
```
241
238
242
239
The output will be an identifier (such as 6D8B81F6-7C79-444C-8858-4AF896C03C67) which corresponds to Azure AD ObjectID assigned to `richel@cqclinic.onmicrosoft.com`
243
240
When a SQL Server authentication login user is the database owner, execute the following statement in the master database to verify the database owner:
244
241
245
242
```
246
-
247
243
SELECT d.name, d.owner_sid, sl.name
248
244
FROM sys.databases AS d
249
245
JOIN sys.sql_logins AS sl
@@ -255,27 +251,17 @@ ON d.owner_sid = sl.sid;
255
251
256
252
Instead of using Azure AD users as individual owners of the database, use an Azure AD group as a member of the **db_owner** fixed database role. The following steps, show how to configure a disabled login as the database owner, and make an Azure Active Directory group (`mydbogroup`) a member of the **db_owner** role.
257
253
1. Login to SQL Server as Azure AD admin, and change the owner of the database to a disabled SQL Server authentication login. For example, from the user database execute:
258
-
259
-
```
260
-
ALTER AUTHORIZATION ON database::testdb TO DisabledLogin;
261
-
262
-
```
263
-
254
+
```
255
+
ALTER AUTHORIZATION ON database::testdb TO DisabledLogin;
256
+
```
264
257
2. Create an Azure AD group that should own the database and add it as a user to the user database. For example:
265
-
266
-
```
267
-
268
-
CREATE USER [mydbogroup] FROM EXTERNAL PROVIDER;
269
-
270
-
```
271
-
258
+
```
259
+
CREATE USER [mydbogroup] FROM EXTERNAL PROVIDER;
260
+
```
272
261
3. In the user database add the user representing the Azure AD group, to the **db_owner** fixed database role. For example:
273
-
274
-
```
275
-
276
-
ALTER ROLE db_owner ADD MEMBER mydbogroup;
277
-
278
-
```
262
+
```
263
+
ALTER ROLE db_owner ADD MEMBER mydbogroup;
264
+
```
279
265
280
266
Now the `mydbogroup` members can centrally manage the database as members of the **db_owner** role.
281
267
- When members of this group are removed from the Azure AD group, they automatically loose the dbo permissions for this database.
@@ -284,9 +270,7 @@ Now the `mydbogroup` members can centrally manage the database as members of the
284
270
To check if a specific user has the effective dbo permission, have the user execute the following statement:
285
271
286
272
```
287
-
288
273
SELECT IS_MEMBER ('db_owner');
289
-
290
274
```
291
275
292
276
A return value of 1 indicates the user is a member of the role.
@@ -338,9 +322,7 @@ GO
338
322
### D. Transfer ownership of an endpoint to a SQL Server login
339
323
The following example transfers ownership of endpoint `CantabSalesServer1` to `JaePak`. Because the endpoint is a server-level securable, the endpoint can only be transferred to a server-level principal.
340
324
341
-
||
342
-
|-|
343
-
|**Applies to**: [!INCLUDE[ssKatmai](../../includes/sskatmai-md.md)] through [!INCLUDE[ssCurrent](../../includes/sscurrent-md.md)].|
325
+
**Applies to**: [!INCLUDE[ssKatmai](../../includes/sskatmai-md.md)] through [!INCLUDE[ssCurrent](../../includes/sscurrent-md.md)].
344
326
345
327
```
346
328
ALTER AUTHORIZATION ON ENDPOINT::CantabSalesServer1 TO JaePak;
@@ -349,13 +331,11 @@ GO
349
331
350
332
### E. Changing the owner of a table
351
333
Each of the following examples changes the owner of the `Sprockets` table in the `Parts` database to the database user `MichikoOsada`.
352
-
353
334
```
354
335
ALTER AUTHORIZATION ON Sprockets TO MichikoOsada;
355
336
ALTER AUTHORIZATION ON dbo.Sprockets TO MichikoOsada;
356
337
ALTER AUTHORIZATION ON OBJECT::Sprockets TO MichikoOsada;
357
338
ALTER AUTHORIZATION ON OBJECT::dbo.Sprockets TO MichikoOsada;
358
-
359
339
```
360
340
361
341
### F. Changing the owner of a database
@@ -371,9 +351,7 @@ ALTER AUTHORIZATION ON DATABASE::Parts TO MichikoOsada;
371
351
In the following example, an Azure Active Directory administrator for SQL Server in an organization with an active directory named `cqclinic.onmicrosoft.com`, can change the current ownership of a database `targetDB` and make an AAD user `richel@cqclinic.onmicorsoft.com` the new database owner using the following command:
372
352
373
353
```
374
-
375
354
ALTER AUTHORIZATION ON database::targetDB TO [rachel@cqclinic.onmicrosoft.com];
376
-
377
355
```
378
356
379
357
Note that for Azure AD users the brackets around the user name must be used.
0 commit comments