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
This is only a preview. Your comment has not yet been posted.
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.
Posted by: |