?
Solved

Using db_chaining in sql2005

Posted on 2011-03-01
3
Medium Priority
?
920 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 7

Accepted Solution

by:
FemSteenkamp earned 668 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 668 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 664 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

762 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