Sample
Table A
-------------------
Col A1 | Col A2 | Col A3
1 XYZ 10
2 MNO 20
Table B
-------------------
Col B1 | Col B2 | Col B3 | Col B4
1 x m 10
2 y n 20
Query Resultset
-------------------
Col A1 | Col A2 | Col A3 | Col B1 | Col B2 | Col B3 | Col B4
1 XYZ 10 null null null
null
2 MNO 20 null null null
null
null null null 1 x
m 10
null null null 2 y
n 20
So I will send this query in DTS to generate a Text file as shown in
resultset.
Please friend any one can suggest something..
Irrespective of relation I want to fetch data from both table and form
File so what can be the query to do so.
Hi chintu4uin,
The query to get this result set is as follows:
SELECT ColA1, ColA2, ColA3,
NULL AS ColB1, NULL AS ColB2, NULL AS ColB3
FROM TableA
UNION ALL
SELECT NULL AS ColA1, NULL AS ColA2, NULL AS ColA3,
ColB1, ColB2, ColB3
FROM TableB;
How to embed this in DTS is beyond me, for I never used DTS. But I
assume you can just call this query from DTS and get the results.
--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Hi Hugo Kornelis, thnx for u r reply ur suggestion works.