Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Using db_chaining in sql2005

Posted on 2011-03-01
3
Medium Priority
?
924 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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

649 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