How to Use Variables With the Send Mail Task in SSIS

Save

Microsoft SQL Server Integration Services (SSIS) support data migration between different data sources and database architectures. During the processing and transferring of data between one source and the next, many smaller maintenance or processing tasks occur; SSIS contains built-in scripts and task handlers to account for these. A basic task is the Send Mail task, which lets the system email you or another user when a specific event occurs. These messages can even contain system variables either in the content or subject line.

Things You'll Need

  • Microsoft SQL Server Business Intelligence Development Studio
  • Create a new SSIS Package in Business Intelligence Studio by selecting "File | New | New Project." In the New Project window, select "Integration Services Project" and then click "OK." A new package will be created under the "packages" directory in solution explorer on the left side of the window. Double-click the package name to expose the Tasks menu and then drag a Send Mail task to the main project developer window.

  • Double-click the "Send Mail" task to open the Send Mail task editor.

  • Click the "Mail" option in the Send Mail task editor, located in the left window pane.

  • Select the "Subject" option in the Send Mail task editor's right pane.

  • Include a system variable expression in the Subject line. This includes dynamic system content generated at run time. This method also works in the Message option as well. The following expression illustrates an expression with a system variable:

    Subject: "From Me at: " + @[System::MachineName]

References

Promoted By Zergnet

Comments

Related Searches

Check It Out

Geek Vs Geek: Robot battles, hoverboard drag race, and more

M
Is DIY in your DNA? Become part of our maker community.
Submit Your Work!