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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to check no of records in a table

Status
Not open for further replies.

asini

Technical User
Nov 13, 2008
22
US
Hello All,

some how we get data from different sources to Database table,
in our SSIS package, it needs to be write all table data to a .csv file, then it clears the table(by using execute sql task)

now the problem here is, when there is no rows in table then it is creating 0 rows .csv file, how to check if there is atleast 1 row in table then create csv file ,otherwise (if zero rows) it shouldn't

could some one help me in reragds to this solution

can any one tell me is Row count helpful to me (if yes can u please direct me..)
, or any other solution

please i am really stucked here

Thanks in advance
asini
 
The data flow needs a destination in oder for it to validate so it will create the file regardless of the number of records. Your best option is to have a preceeding dataflow that exutes a query to count your records in a table you can then assign this value to a variable using the rowcount task. in your control flow you would place and expression on your control flow that would execute your extract dataflow only when the row count was greater than 0.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top