Microsoft
Software
Hardware
Network
Question : cross database view or something in SQL Serve?
I have several similar databases (for example, IT dept employee list, HR employeeList, etc.). What is the best practice to create a view for cross database join or query? Any link on this topic? Thanks.
Answer : cross database view or something in SQL Serve?
If the databases are on the same server you can simply join by prefixing the database name at the beginning such as this example using northwind and pubs
use northwind
go
select a.customerid, a.companyname,b.city
from customers a
inner join pubs.dbo.stores b
on a.city = b.city
Here are associated urls:
1)
http://groups.google.com/g
roup/
micro
soft.publi
c.sqlserve
r.programm
ing/browse
_thread/th
read/
7e79d
2f07a5aafc
8/80afcd11
b7401e8d?h
l=en&lnk=s
t&q=datbas
es+
join+gr
oup%3A*sql
server*#80
afcd11b740
1e8d
2)
http://www.sqlteam.com/for
ums/topic.
asp?TOPIC_
ID=6086
3)
http://www.issociate.de/bo
ard/post/2
97358/
Join
ing_tables
_in_differ
ent_databa
ses.html
If the databases are on different servers you'll need to create a linked server. Let me know if this is your situation and more detail will be provided.
Random Solutions
IIF query using Like *
SUser_Name function in sql server
Remote ms access back end
Custom indexing on sub folders
wiaManager = new WiaClass(); // create COM instance of WIA manager
How to import table from Oracle DB with ODBC ?
Microsoft SQL Server Cluster - Currently only uses port 1815, can 1433 be enabled?
Blue Screen Windows 7 - Memory_Management 0x0000001a
How do I import data (number values) into access with multiple decimal places, i.e., 64.01.01?
cleaning registry from nav, symantec, and mcafee