Follow sqlserver-dba.com

Subscribe to RSS feed  Follow @jackvamvas - Twitter

*Use the Comments section for questions

SQLServer-DBA.com Links

Dba_db2_button

dba-ninja.com

SQL Server DBA Jobs

How do I check my cross DB ownership chaining?

15 December,2022 by Tom Collins

Cross-database ownership chaining is a SQL Server  security feature allowing database users  access to other database objects hosted on the same SQL server instance, in the case where database  users don't have access granted explicitly

Two examples of situations where cross-database ownership occurs.

1) A database view joining data from tables residing on multiple databases 

2) A stored procedure accessing multiple database objects but at  the same time restricting access to the underpinning tables

 

How do I check my cross DB ownership chaining ?

 SELECT is_db_chaining_on, name FROM sys.databases;

 

To enable for an individual database 

ALTER DATABASE [MY_DATABASE_NAME] SET DB_CHAINING ON

Use this command to enable cross-database ownership chaining in all databases

USE master;
GO
EXECUTE sp_configure 'show advanced', 1;
RECONFIGURE;
EXECUTE sp_configure 'cross db ownership chaining', 1;
RECONFIGURE;

 

Read more on SQL Security 

How to get user security changes with SQL default trace

Troubleshoot SQL Security Error Ring Buffer Recorded

SQL Server Security Policy


Author: Tom Collins (http://www.sqlserver-dba.com)


Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on How do I check my cross DB ownership chaining?


sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer