MS SQL Server
  Home arrow MS SQL Server arrow Page 3 - Using Data Transformation Services: Captur...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MS SQL SERVER

Using Data Transformation Services: Capture Recordset with a Global Variable
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 8
    2005-09-20

    Table of Contents:
  • Using Data Transformation Services: Capture Recordset with a Global Variable
  • The Query on the Northwind database
  • Stuffing rowset into a global variable
  • Retrieve rowset using Activex Script

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Using Data Transformation Services: Capture Recordset with a Global Variable - Stuffing rowset into a global variable


    (Page 3 of 4 )

    Let us start off by creating a package called AdoRecords. This is saved in the SQL server with Windows authentication, shown in the next picture.

    Next, an Execute SQL task is added, which requires at least one connection. This next picture shows the set up information for this connection. Since we are interested in assigning the query against the Northwind database, Northwind database has been chosen for this connection with Windows authentication.

    Now from the tasks collection/ or from menu add an Execute SQL Task. If you want you may give a name to this task. As documented in detail in my other dts articles, you may build the query from scratch, or if you have already tested the query you may copy and paste it here. This is a simple enough query, as you saw earlier in this tutorial. This query returns four columns (fields) as seen in the query.

    In the earlier article it was mentioned that you have the option of setting up global variables from the package properties, or it can be implemented as a part of the Execute SQL Task. For this tutorial we will be using this method. Now click on the button Parameters..., this opens up the window shown next. Since we are interested in the output only, the input parameters tab was skipped, and we are now in the output parameters tabbed window. The GUI is correctly showing the output from the query.

    Now click on the button Create Global variables.... This will bring up the next screen. This screen allows you to flexibly manipulate the Global Variables. For the variable column type in Contacts. This is the variable to which the result set from the query will be assigned. For the column Type choose Other, and leave the Value column blank as shown.

    Now click on OK to bring up the next screen. Click on Rowset, and in the drop-down list choose the only one in this tutorial, Contacts. In summary, through this screen you are assigning the query results to the Global variable, Contacts. Click OK to this screen and the assignment is completed.

    More MS SQL Server Articles
    More By Jayaram Krishnaswamy


       · Most of my tutorials on DTS deals with the usage of the DTS Designer. I am...
     

    MS SQL SERVER ARTICLES

    - Completing the Introduction to Transact-SQL
    - A Brief Introduction to Transact-SQL
    - Lookups and Blocking Bad Data
    - Field Validation Rules for Blocking Bad Data
    - Using Masks to Block Bad Data
    - Blocking Bad Data
    - Using @@ROWCOUNT and TABLE Variables for Dat...
    - How to Use Variables, IF and CASE in Databas...
    - Creating Important Aspects of Notification S...
    - Working wth Variables in Database Interactio...
    - Delving Deeper into Notification Services
    - Notification Services
    - Building a Multi-table Report with SQL 2005 ...
    - A Secure Way of Building Connection Strings
    - Transferring a Database Using the SSIS Desig...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT