Avatar of webdork
webdork asked on

DTS Package run Stored Procedure and Email export File

How can I run a stored procedure on my DTS package (a daily export from SQL Server to csv file) then Email the results:  
SQL Server 2000
Win Server 2003
Microsoft SQL ServerASP

Avatar of undefined
Last Comment

8/22/2022 - Mon

for email see

for stored proc, you need to create an "execute sql task" task in your dts package (the yellow cylinder with the red arrows). if your stored proc returns a select statement and you want to capture the results on the stored proc and output into a file you need to insert the results of the sp into a table. create a table that has identical structure to the sp result set (same fields, same number of columns, same column order etc) then output this table into your file.
for eg
insert tblTemp
exec mystoredProc

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Your help has saved me hundreds of hours of internet surfing.