Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Data Driven Subscriptions Render Formats Expand / Collapse
Posted Wednesday, September 18, 2013 4:45 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, October 31, 2013 6:06 AM
Points: 4, Visits: 17

I've created a few data-driven subscriptions and one of the requirements is that the subscription sends an emailed csv file. However, when the email is received, the csv file opens by default into Excel, and it wants to save as a Microsoft Excel Comma Separated Value file, or something else. Is there any way to either email a non-formatted csv file, or even a .txt file? I've amended the Render Format table we use to read TXT, but the email doesn't send at all.


Post #1495839
Posted Thursday, September 19, 2013 4:54 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Friday, November 18, 2016 1:24 AM
Points: 3,662, Visits: 1,510
Assuming the data driven subscription is based on something like below.

CREATE TABLE dbo.Subscribers(
EmailRecipient varchar(100),
Format varchar(20),
ParameterValueX varchar(30)

1. Keep the format as CSV to preserve the output format. The TXT value is unrecognised so will not succeed.
2. When asked for the query calculate the filename of the attachment

SELECT EmailRecipient, Format ParameterValueX, 'Data.TXT' as Filename
FROM dbo.Subscribers

3. During the data driven subscription wizard set :
- the option for format to the Format column or hard-coded to CSV
- the option for file extension to false (i.e. you do not want .CSV added to the end of the attachments filename)
- the option for file name should be the filename column from the query (not .TXT showing at the end


Post #1496305
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse