Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Microsoft SQL Server 2012 Integration Services: An Expert Cookbook

You're reading from   Microsoft SQL Server 2012 Integration Services: An Expert Cookbook Over 80 expert recipes to design, create, and deploy SSIS packages with this book and ebook

Arrow left icon
Product type Paperback
Published in May 2012
Publisher Packt
ISBN-13 9781849685245
Length 564 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Toc

Table of Contents (23) Chapters Close

Microsoft SQL Server 2012 Integration Services: An Expert Cookbook
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started with SQL Server Integration Services 2. Control Flow Tasks FREE CHAPTER 3. Data Flow Task Part 1—Extract and Load 4. Data Flow Task Part 2—Transformations 5. Data Flow Task Part 3—Advanced Transformation 6. Variables, Expressions, and Dynamism in SSIS 7. Containers and Precedence Constraints 8. Scripting 9. Deployment 10. Debugging, Troubleshooting, and Migrating Packages to 2012 11. Event Handling and Logging 12. Execution 13. Restartability and Robustness 14. Programming SSIS 15. Performance Boost in SSIS Index

Executing T-SQL commands: Execute SQL Task


One of the most useful tasks in SSIS is the Execute SQL Task. This task can be used for executing every T-SQL command on an underlying database. Underlying databases can vary because there is a wide variety of connection managers that have SQL Task support. In this recipe, we will see some of the most useful scenarios such as the execution of T-SQL commands and fetching results, or passing input and output parameters.

How to do it...

  1. Open SSTD and create a new Integration Services Project type at the following location: C:\SSIS\Ch02_Control Flow Tasks\ and name the project R01_Execute SQL Task.

  2. Rename the package as P01_SingleRowResultSet.dtsx.

  3. From the SSIS menu select Variables; the Variables pane will appear. Create a new variable with the Name RowCount and Data type Int32 at the package Scope.

  4. In the empty package's Control Flow tab, drag-and-drop a Execute SQL Task from the toolbox under Favorites into the Control Flow.

  5. Double-click on Execute SQL...

You have been reading a chapter from
Microsoft SQL Server 2012 Integration Services: An Expert Cookbook
Published in: May 2012
Publisher: Packt
ISBN-13: 9781849685245
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image