Home > Ask the SQL Server Experts > Archive: Development Questions & Answers > Cross database access when executing stored procedures
Ask The SQL Server Expert: Questions & Answers
EMAIL THIS

Cross database access when executing stored procedures

Greg Low EXPERT RESPONSE FROM: Greg Low

Pose a Question
Other SQL Server Categories
Meet all SQL Server Experts
Become an Expert for this site


Expert advice on database development
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


>
QUESTION POSED ON: 15 August 2006
In VB.NET, I am trying to execute a stored procedure that tries to insert values into a table using a SELECT statement. The SELECT statement uses tables from this database and also uses a view containing this database's tables and a table from a different database. When I try to execute the procedure, I get an error message that the user ID in my connection string does not have rights to the different database. What would be the solution to this problem?


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED CONTENT
SQL Server Stored Procedures
SQL Server Mailbag: CALs, witnesses and unwanted changes
SQL Server Mailbag: Stored procedures, triggers and SSRS reports
Top tips and tricks for SQL Server database development
Top 10 SQL Server development tips of 2008
SQL Server trigger vs. stored procedure to receive data notification
SQL Server errors, failures and other problems fixed from the trenches
SQL Server and data manipulation in T-SQL
How to use SQL Server 2008 hierarchyid data type
SQL Server stored procedures tutorial: Write, tune and get examples
Check SQL Server database and log file size with this stored procedure

.NET Development for SQL Server
Creating Windows PowerShell scripts to manage SQL Server 2008 instances
Manipulate column names in a SQL Server table
Code to restore SQL Server databases in VB.NET
Custom VB.Net scripting in SQL Server Integration Services
Retrieve images from SQL Server and store in VB.Net
Connect to SQL Server database with Visual Basics
Top 10 SQL Server development questions
Developing CLR database objects: 10 tips, 10 minutes
CLR architecture
CLR stored procedures
.NET Development for SQL Server Research

Archive: Development
Copy stored procedure between SQL Server 2005 databases
Should developers have permissions to SQL Server production queue?
Schedule stored procedure and save output to network drive
Query to find SQL Server database names created by users
Is it possible to find disabled indexes in SQL Server 2000?
SQL Server id permission to create and modify tables
Problem attaching stored procedure and SQL Server trigger
Installing different SQL Server versions on one machine
Calling an extended stored procedure in SQL Server 2005
Multiple SQL Server instances vs. multiple databases

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
library  (SearchSQLServer.com)
trigger  (SearchSQLServer.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


The thing to investigate here that will allow access across databases is cross-database ownership chaining. The behavior of this function was modified in SQL Server 2000's Service Pack 3. Take a look at the entry in Books Online called "Cross DB Ownership Chaining option." Make sure you have an updated copy of Books Online too.




Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



SQL Solutions - SQL Database Design
HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2005 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts