SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 SSIS Variable to Parameter to SQL Mapping
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

gbritton
Aged Yak Warrior

754 Posts

Posted - 02/05/2014 :  12:00:32  Show Profile  Reply with Quote
An interesting article here about type mapping:

http://msdn.microsoft.com/en-us/library/ms345165(SQL.90).aspx


That link is mostly helpful but it leads to more questions:

1. Can we use the methods described in our SSIS packages? How? (Examples)

2. Is there a mapping of SSIS variable types to Parameter types and Parameter types to SQL types?

e.g The system variable System:StartTime is of type DateTime (in the Variables tab).

In the Execute SQL task, in the Parameters tab, there is no type DATETIME in the drop-down. There is DATE, DBDATE, DBTIMESTAMP and some others. Note that they are not the same as the variable types (thanks, SSIS, for making life difficult!)

Say that you want to pass the variable System::StartTime to a query in an Execute SQL Task where the SQL data type is DATETIME. We have:

Variable Variable Type SQL type Parameter tab type
----------------- ------------ -------- ------------------
System::StartTime DateTime DATETIME ???


By process of elimination, I discovered that the Parameter type in this case is DATE. That is confusing, since it actually does pass in the time as well.

Now, there are several SSIS variable types (11 in 2008-r2) and several Parameter types (27 in 2008-r2) and lots of SQL types. Is there a matrix somewhere that maps all three together?

Edited by - gbritton on 03/20/2014 15:55:46
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000