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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How to Join Multiple Views into a single View

Author  Topic 

palaparu
Starting Member

20 Posts

Posted - 2010-10-28 : 10:08:45
How to Join Multiple Views into a single View

I have a view for each database. Now i want to combine all the views in to a single view

Is this possible... can any one reply here?
Thanxx in advance

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-10-28 : 10:14:16
Are you able to do a query that uses (joines) all the needed views?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

notmyrealname

98 Posts

Posted - 2010-10-28 : 10:17:48
If the views have the same structure then you might be talking about a UNION that will combine the data.
Go to Top of Page

palaparu
Starting Member

20 Posts

Posted - 2010-10-28 : 10:24:45
This is question. I created views for some columns in each database. Now i need to combine all the views

(DB 1) - (VIEW of some columns) -
(DB 2) - (VIEW of some columns) - } [ combine all the views ]
(DB 3) - (VIEW of some columns) -

so how to combine these views in SQL Server 2005 ? (whether to use join or Union, or can i map graphically)
Go to Top of Page

notmyrealname

98 Posts

Posted - 2010-10-28 : 11:32:23
can you tell us the columns for each view?
Go to Top of Page

palaparu
Starting Member

20 Posts

Posted - 2010-10-28 : 11:42:09
i need all the columns from the views

(DB 1)10 tables - (VIEW of some columns)2 columns -
(DB 2)10 tables - (VIEW of some columns)2 columns - } [ combine all the views ]
(DB 3)10 tables - (VIEW of some columns)2 columns -

from 10 tables. I selected 2 columns from each of the database
i need to combine 3 views




Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2010-10-28 : 13:40:23
Do you have Books Online?

If so you might want to look up the UNION operator or, possibly, do some form of JOIN (CROSS, FULL, LEFT, RIGHT, INNER).

If that doesn't help, maybe you can present your question in more detail so that we can actually provide you with an answer. This link may help with that:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page
   

- Advertisement -