Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Access tables in different DB on same server

Posted on 2010-11-11
2
Medium Priority
?
271 Views
Last Modified: 2013-11-05
On the same MS SQL 2005 server, I want to access tables in a different DB. The DB my code is in, for example, is Prothera. The other DB is MOM. So my stored procs and table value functions that I'm using are in Prothera. So I'm accessing tables in Prothera and in MOM.  thx
0
Comment
Question by:prothera
[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
2 Comments
 
LVL 93

Accepted Solution

by:
Patrick Matthews earned 1000 total points
ID: 34114344
Just fully qualify your table references, e.g.,SELECT *FROM DB_Name.dbo.Table_Name
0
 

Author Comment

by:prothera
ID: 34114380
Excellent! I thought this would be easy for you experts! Thank-you!
0

Featured Post

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

664 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