MS SQL Server
  Home arrow MS SQL Server arrow Page 3 - Using Data Transformation Services: Using ...
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 
Dedicated Servers 
Moblin 
JMSL Numerical Library 
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: Using DTS Lookups, Introduction
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 20
    2005-08-24

    Table of Contents:
  • Using Data Transformation Services: Using DTS Lookups, Introduction
  • DTS Lookup with multiple arguments
  • Example continued
  • DTS Lookup returning multiple values

  • 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: Using DTS Lookups, Introduction - Example continued


    (Page 3 of 4 )

    On clicking the ellipsis button the following query designer pops up. Herein, the previously mentioned query is configured as shown. The details of how this is carried out have already been discussed in previous DTS tutorials. This is the same query we started with in the beginning.

    The 'Source' and 'Destination' needed for this transformation are shown here.

     

     

    Now in the above windows, accessing the General tab leads to the Activex scripting window shown here. The picture is not clear, but the package objects can be seen in the left pane.

     

    The ActiveX script that makes this transformation is shown in the next paragraph. The variable iTitle is assigned the value returned by the lookup query, "GetTitle" by passing the two arguments au_lname and state. The syntax is: returnValue=DTSLookups().Execute(param1, param2). This is then passed to the DTS Destination.

    '**********************************************************************
    '  Visual Basic Transformation Script
    '************************************************************************
    '  Copy each source column to the destination column
    Function Main()
    iTitle=DTSLookups("GetTitle").Execute(DTSSource("au_lname") ,
    DTSSource("state")) DTSDestination("title")=iTitle Main = DTSTransformStat_OK End Function '************************************************************************

    As discussed in previous tutorials, it can be parsed and tested in the Activex designer interface. This completes the Transform Data task and results in the previous window shown earlier (the finished product!). When this package is run, the MS Access database table gets populated as shown in the next picture, which is the result required.

    More MS SQL Server Articles
    More By Jayaram Krishnaswamy


       · Most of the articles on DTS written by me including the present one use the...
       · Hi,I am pretty new to DTS but not to ETL. One of the major requirements I have...
     

    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 3 hosted by Hostway