SolvedPrivate

SSIS output to text file

Posted on 2015-02-02
5
20 Views
Last Modified: 2016-02-15
Looking for an easier way to accomplish this in SSIS.  
if number of  rows  in a table CUSTOMER  is 3 or less  ie count(*)  < = 3  write a blank  textfile to  c:\customerinfo.txt else select * from
Customer  to c:\customerinfo.txt
0
Comment
Question by:Nana Hemaa
  • 3
5 Comments
 
LVL 65

Assisted Solution

by:Jim Horn
Jim Horn earned 150 total points
ID: 40585645
In your data flow task that pumps table Customer add a Row Count control, and assign the resulting row count to a variable.

Then in the next control flow, add a precedence constraint that tests the value of that variable, i.e. @@variable_name >= 3, and have the 'true' arrow go to the part that writes the blank text file, 'false' arrow go to the part that SELECT *
0
 

Author Comment

by:Nana Hemaa
ID: 40586743
I added the row count control.   can you explain further how to write the blank text file...

--add a precedence constraint that tests the value of that variable, i.e. @@variable_name >= 3, and have the 'true' --arrow go to the part that writes the blank text file,
0
 
LVL 21

Assisted Solution

by:Alpesh Patel
Alpesh Patel earned 150 total points
ID: 40597754
Hi,

Take rowcount in Variable and using that variable create Source expression and add where condition to that

'select * from
Customer Where ' +
case when variablevalue > 3 then '1=1'  else = '1=2' end
0
 

Accepted Solution

by:
Nana Hemaa earned 0 total points
ID: 40606292
0
 

Author Closing Comment

by:Nana Hemaa
ID: 40613817
Site was more explanatory
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

My client has a dictionary table. They're defining a list of standard naming convention. Now, they are requiring my team to provide us a mechanism how to match new incoming data with existing data in their system.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now