Solved

SQL Stored procedure

Posted on 2015-01-17
2
70 Views
Last Modified: 2015-01-18
I have created a SQL Stored procedure in DatabaseA and it need to refer some tables stored in DatabaseB on the same server. What's the best way to reference those tables ?

Tks
0
Comment
Question by:AXISHK
2 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 300 total points
Comment Utility
you can prefix with the database name:

select * from DatabaseB.dbo.tableName
0
 
LVL 10

Assisted Solution

by:HuaMinChen
HuaMinChen earned 200 total points
Comment Utility
Hi,
Try
insert tab1 (...)
select ...
from DatabaseB.dbo.table2

Open in new window


to refer to the table on other DB
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

Suggested Solutions

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

15 Experts available now in Live!

Get 1:1 Help Now