troubleshooting Question

How to write multiple T-sql in Oledb/ or any other dts component in SSIS

Avatar of motioneye
motioneyeFlag for Singapore asked on
Microsoft SQL Server
16 Comments3 Solutions604 ViewsLast Modified:
I'm writing ssis package ( using oledb source editor ) to query the db then save the result in disk drive as *.csv, the problem is oledb only can be use to run single T-sql command, so if I have a query like below, how do I run this query in ssis then save a results in single file destination ?

select DomName, count(*) as count from TableTest with ( nolock )
where CatID = 1 and trgigerID = 1 AND DomName <> ''
group by DomName order by count(*) desc
GO


select DomName, count(*) as count from TableTest with ( nolock )
where CatID = 1 and trgigerID = 2 AND DomName <> ''
group by DomName order by count(*) desc
GO

select DomName, count(*) as count from TableTest with ( nolock )
where CatID = 1 and trgigerID = 11 AND DomName <> ''
group by DomName order by count(*) desc
GO

select DomName, count(*) as count from TableTest with ( nolock )
where CatID = 2 and trgigerID = 2 AND DomName <> ''
group by DomName order by count(*) desc
GO

select DomName, count(*) as count from TableTest with ( nolock )
where CatID = 2 and trgigerID = 5 AND DomName <> ''
group by DomName order by count(*) desc
GO

select DomName, count(*) as count from TableTest with ( nolock )
where CatID = 4 and trgigerID = 6 AND DomName <> ''
group by DomName order by count(*) desc
GO

ssis-oledb.jpg
ASKER CERTIFIED SOLUTION
Olaf Doschke
Software Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 3 Answers and 16 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 16 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros