Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Sql 2005 create view from different databases

Author  Topic 

lesbail
Starting Member

3 Posts

Posted - 2009-02-04 : 09:32:38
Hi
I have just started looking at Sql 2005 I am usually a Crystal reports man really. I am looking to create a view from several databases that we have on Sql to create a deptors report for the all companies. Is this possible or am I barking up the wrong tree?
Thanks in advance
Les

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-02-04 : 09:40:23
yup. its possible. something like

CREATE VIEW YourView
AS
SELECT columns...
FROM db1.dbo.table1
UNION ALL
SELECT columns...
FROM db2.dbo.table2
UNION ALL
SELECT columns...
FROM db3.dbo.table3
....
Go to Top of Page

lesbail
Starting Member

3 Posts

Posted - 2009-02-04 : 12:44:09
Thats done the trick thanks
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-02-04 : 12:46:14
welcome
Go to Top of Page
   

- Advertisement -