[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Trigger DTS package by Email

Posted on 2006-05-12
11
Medium Priority
?
405 Views
Last Modified: 2013-11-30
Is there a way to run my DTS package upon receipt of a certain email?

XP OS
0
Comment
Question by:webdork
  • 5
  • 3
  • 3
11 Comments
 
LVL 17

Expert Comment

by:Chris Mangus
ID: 16671484
Are you talking about using SQL Mail directly through SQL Server?
0
 

Author Comment

by:webdork
ID: 16671497
idunno...

I want to run a dts package when a particular email arrives. I've heard SQL Mail is a bit iffy, but I'm listening...
0
 
LVL 17

Expert Comment

by:Chris Mangus
ID: 16671542
If you're talking about SQL Mail then sure, you can fire a DTS package that way.  If you're talking about receiving email on your personal email account I think you'd have to write a process that would go through your inbox periodically and then, if it finds a certain email it would use the DTSrun.exe command line utility to run your DTS package.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:webdork
ID: 16671552
OK how do i go about using SQL mail
0
 
LVL 17

Accepted Solution

by:
Chris Mangus earned 1000 total points
ID: 16671565
Once you have SQL Mail set up and running you can send a query like 'EXEC runMyPackage' to execute a stored procedure called runMyPackage.  In that SP you use some syntax like:

Declare @SQL nvarchar(400)

Set @SQL = 'DTSRun /S{myServer} /U{username} /P{password} /N{name of my DTS Package}'
Exec master.dbo.xp_cmdshell @SQL, no_output
0
 
LVL 6

Expert Comment

by:itdrms
ID: 16671606
You can set up a rule in Outlook and upon receipt of your email criteria perform a custom action, start an application, or run a script.
0
 

Author Comment

by:webdork
ID: 16671625
I see how to send a trigger with SQL Mail. but i'm not sure how to receive an email in SQL Server
0
 
LVL 17

Expert Comment

by:Chris Mangus
ID: 16671638
Here are a couple of great links for learning about SQL Mail, how to configure it, and how to use it.

http://sqljunkies.com/Article/0A1F961B-8E50-4E76-8FCE-31A0F800FCC7.scuk
http://www.databasejournal.com/features/mssql/article.php/3293301
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnovba01/html/SQLServerE-mail.asp

Please note, Custom Actions in Outlook are 3rd party tools that are installed to work with Outlook.  It may be very interesting to explore running a script through a rule.
0
 
LVL 6

Assisted Solution

by:itdrms
itdrms earned 1000 total points
ID: 16671681
If that aproach will help you, here's an extract from one of my VBS that accesses SQL (not that I'm taking original credit -- but it's in my script and I know it works) -- you can EXEC as listed above by cmangus

  Dim oConn, oComm
  set oConn= createobject("ADODB.Connection")
  Set oComm = createObject("ADODB.COMMAND")

  oConn.Open ("Provider=sqloledb;" & _                        
              "Data Source=servera\servera;" & _
              "Initial Catalog=" + sSQLdb + ";" & _
              "Integrated Security=SSPI")
  oComm.ActiveConnection = oConn
  oComm.CommandText = "EXEC ..."
  oComm.Execute
  oConn.Close
  Set oComm = Nothing
  Set oConn = Nothing
0
 
LVL 17

Expert Comment

by:Chris Mangus
ID: 16671762
I just took a look at Outlook rules firing scripts.  Very nifty approach itdrms!
0
 
LVL 6

Expert Comment

by:itdrms
ID: 16671774
thank you cmangus, I'm familiar with rules to automatically respond to our users who incorrectly reply to our unmonitored admin email account, and I use a rule to copy my backup on any automated emails from the admin account, so I'm covered if I'm out of the office -- I don't have need to execute a script -- but knew it was an option.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question