SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Data Driven Subscriptions Render Formats


Data Driven Subscriptions Render Formats

Author
Message
DeveloperNewbie
DeveloperNewbie
Grasshopper
Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)

Group: General Forum Members
Points: 16 Visits: 17
Hi

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.

Thanks

Chris
Mark Fitzgerald-331224
Mark Fitzgerald-331224
Hall of Fame
Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)

Group: General Forum Members
Points: 3884 Visits: 1538
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

Done

Fitz
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search