Link to home
Start Free TrialLog in
Avatar of Abdul Khan
Abdul Khan

asked on

Add a data line when the SQL SP creates a blank file

I use a SP to extract a CSV file daily, once in a while I get a blank file when there is no matching query; how do I add a line that simply says "No data today"  and add it to my file when there is a blank file so my user can see the message..
Avatar of PatHartman
PatHartman
Flag of United States of America image

Count the selected rows.  If the count is >0, export the query.  If the count is 0, export a single record with the message in it.
What does your query look like?
Can you please post the code you are using to retrieve the data.
ASKER CERTIFIED SOLUTION
Avatar of Arifhusen Ansari
Arifhusen Ansari
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Abdul Khan
Abdul Khan

ASKER

Thank you.