Solved

Using db_chaining in sql2005

Posted on 2011-03-01
3
906 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

932 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

11 Experts available now in Live!

Get 1:1 Help Now