Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export Text only if Query Returns Data

Status
Not open for further replies.

jrennatc2

Programmer
Apr 18, 2007
5
US
Is there a way in DTS to create a text file from a query only if the query returns data? I think I could do it with an activex script, but I really don't want to hardcode my database user and password info.
 
You need to use activeX script for this, unless you want to create the text file using t-SQL. If you decide to do it that way, have a look at bcp in SQL Server help.

Hope this helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Thanks Alex. I ended up just writing an ActiveX script that deleted the file that was produced if the file size was 0. So far, it seems to be what I needed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top