Solved

Using db_chaining in sql2005

Posted on 2011-03-01
3
903 Views
Last Modified: 2012-06-27
I wanted to use db_chaining with our sql205 instance, if I have 5 databases ( same table ) name which I'm going to set ON for db_chaining. Then If I want to query data for all these 5 databases in single query ? how should my scripts works ?
actually what is db_chaining use for ?
0
Comment
Question by:motioneye
3 Comments
 
LVL 7

Accepted Solution

by:
FemSteenkamp earned 167 total points
ID: 35005759
DB chaining has just got to do with the permissions needed to access underlying tables.

you will still have to use something like linked servers or openrowset function with some joins to get a single result.

can you elaborate a bit more about what you want to achieve?
0
 
LVL 25

Assisted Solution

by:reb73
reb73 earned 167 total points
ID: 35005866
You don't have to enable db_chaining to query from 5 databases on the same server. Provided a login has access to the databases and is mapped to a database user, you can use the three part object reference (<dbname>.<schema>.<object>) to access objects across  multiple databases.

With db_chaining enabled, a login does not have to be necessarily mapped to a database user, but still needs to be given explicit access to the target databases and the 'guest' database user is used to map into the objects required..

Review the link below, which gives you an idea of how it works and possible security issues using db_chaining -

http://www.mssqltips.com/tip.asp?tip=1782
0
 
LVL 15

Assisted Solution

by:Aaron Shilo
Aaron Shilo earned 166 total points
ID: 35005868
hi
for retriving data from all tables you will need to query them normally by referencing the SERVER.DB.SCHEMA.TABLE.

DB_CHANING
from msdn : "Use the Cross DB Ownership Chaining option to configure cross-database ownership chaining for the instance of SQL Server. This security enhancement was added in SQL Server 2000 SP3 to allow you to manage cross-database security.

This server option allows you to control cross-database ownership chaining at the database level or to allow cross-database ownership chaining for all databases:
"
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now