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
frankytee

8/22/2022 - Mon
frankytee

for email see
https://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/DTS/Q_23021922.html

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
etc
ASKER CERTIFIED SOLUTION
frankytee

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
or
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.
fblack61