Tuesday, March 20, 2012

Combine result sets

Hi,
In my project, I need to combine multiple result sets into one single result
set for further processing. However, the result sets are not having the
same table structure and therefore I can't use union. Any ideas on how I
should do it?
Thanks.Cherly
Create a temporary table , so some of the columns will contrain NULLs or
create DEFAULT constraint
"Cheryl" <justtosayhi@.excite.com> wrote in message
news:BA3FE0A3-D1C9-41C7-B10B-5DDFB0C16284@.microsoft.com...
> Hi,
> In my project, I need to combine multiple result sets into one single
> result set for further processing. However, the result sets are not
> having the same table structure and therefore I can't use union. Any
> ideas on how I should do it?
> Thanks.|||On Sep 19, 10:33 pm, "Cheryl" <justtosa...@.excite.com> wrote:
> Hi,
> In my project, I need to combine multiple result sets into one single result
> set for further processing. However, the result sets are not having the
> same table structure and therefore I can't use union. Any ideas on how I
> should do it?
> Thanks.
overall it's easier to ensure that result sets have identical
structure.
add something like this to you result sets:
CAST(NULL AS MissingColumnType) AS MissingColumnName|||How different are the recordsets ? Is it just a question of creating a
couple of columns with '' as the value, so you can
get to the point of using UNION
--
Jack Vamvas
___________________________________
Need an IT job? http://www.ITjobfeed.com/SQL
"Cheryl" <justtosayhi@.excite.com> wrote in message
news:BA3FE0A3-D1C9-41C7-B10B-5DDFB0C16284@.microsoft.com...
> Hi,
> In my project, I need to combine multiple result sets into one single
> result set for further processing. However, the result sets are not
> having the same table structure and therefore I can't use union. Any
> ideas on how I should do it?
> Thanks.

No comments:

Post a Comment