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)
 Adding value to integer

Author  Topic 

xlatos
Starting Member

2 Posts

Posted - 2009-07-29 : 08:03:56
Hey,

I have some problem
I wrote some Storage procedure script that gives me an rows from 3 tables, and i wonder if i can attach those 3 outputs i have got into one big output (maybe to keep the information in an integer? is that possible ?)

ddramireddy
Yak Posting Veteran

81 Posts

Posted - 2009-07-29 : 08:23:15
Use UNION ALL

select your columns from Table1
union all
select your columns from Table2
union all
select your columns from Table3

remember all those columns should be same number and same type.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-07-29 : 08:23:43
how does the output looks like ? How do you want to combine into one output ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

xlatos
Starting Member

2 Posts

Posted - 2009-07-29 : 08:55:31
i have used the UNION ALL and it works great. Thanks allot.

I wonder with the output i have got now how do i fillter duplications?
Go to Top of Page

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-07-29 : 08:57:59
quote:
Originally posted by xlatos

i have used the UNION ALL and it works great. Thanks allot.

I wonder with the output i have got now how do i fillter duplications?



Use UNION instead Of UNION ALL

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page
   

- Advertisement -