dbTalk Databases Forums  

Using SQLCLR function returning SqlDateTime in DataFlow

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Using SQLCLR function returning SqlDateTime in DataFlow in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mirek Endys
 
Posts: n/a

Default Using SQLCLR function returning SqlDateTime in DataFlow - 09-18-2008 , 06:24 AM






I made SQLCLR function that returns SqlDateTime form integer value. I
deployed it succesfully on the server but I dont know, how to use it in the
DataFlow.

When I use it in the SQLQuery window on the SQL Server, it works well
example: SELECT dbo.JulianToGregorian (98001, 1900)
returns: 1998-01-01 00:00:00.000

But I would like to use it in the DataFlow component like OLE DB Command is,
or Derived Column, or in expression of the variable. I need to convert flown
value during dataflow by this SQLCLR function. How to do it?

Thanks.

Reply With Quote
  #2  
Old   
Charles Wang [MSFT]
 
Posts: n/a

Default RE: Using SQLCLR function returning SqlDateTime in DataFlow - 09-19-2008 , 12:10 AM






Hi Mike,
Thank you for using Microsoft MSDN Managed Newsgroup.

Regarding your question, could you please elaborate your requirement so that we can better understand it and give out a
specific resolution?

There is no difference to use a normal UDF or a CLR UDF in OLE DB Command. You can simply input "SELECT
dbo.JulianToGregorian (98001, 1900)" in the SqlCommand property field. If you want to use the result as an input column
to the next component, I recommend that you use OLE DB Source. If you want to use SSIS variables together with the T-
SQL statement, I recommend that you consider using Execute SQL Task together with your data flow task. You can refer to
the following articles:
Amazing SSIS: Parameters in Execute SQL Task
http://blogs.msdn.com/msdnts/archive...-sql-task.aspx
SSIS: Mapping parameter inside of a Execute SQL Task, OLE DB Source Component or Datareader component
http://rafael-salas.blogspot.com/200...inside-of.html

Hope this helps!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...#notifications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======





Reply With Quote
  #3  
Old   
Charles Wang [MSFT]
 
Posts: n/a

Default RE: Using SQLCLR function returning SqlDateTime in DataFlow - 09-19-2008 , 12:10 AM



Hi Mike,
Thank you for using Microsoft MSDN Managed Newsgroup.

Regarding your question, could you please elaborate your requirement so that we can better understand it and give out a
specific resolution?

There is no difference to use a normal UDF or a CLR UDF in OLE DB Command. You can simply input "SELECT
dbo.JulianToGregorian (98001, 1900)" in the SqlCommand property field. If you want to use the result as an input column
to the next component, I recommend that you use OLE DB Source. If you want to use SSIS variables together with the T-
SQL statement, I recommend that you consider using Execute SQL Task together with your data flow task. You can refer to
the following articles:
Amazing SSIS: Parameters in Execute SQL Task
http://blogs.msdn.com/msdnts/archive...-sql-task.aspx
SSIS: Mapping parameter inside of a Execute SQL Task, OLE DB Source Component or Datareader component
http://rafael-salas.blogspot.com/200...inside-of.html

Hope this helps!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...#notifications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======





Reply With Quote
  #4  
Old   
Charles Wang [MSFT]
 
Posts: n/a

Default RE: Using SQLCLR function returning SqlDateTime in DataFlow - 09-19-2008 , 12:10 AM



Hi Mike,
Thank you for using Microsoft MSDN Managed Newsgroup.

Regarding your question, could you please elaborate your requirement so that we can better understand it and give out a
specific resolution?

There is no difference to use a normal UDF or a CLR UDF in OLE DB Command. You can simply input "SELECT
dbo.JulianToGregorian (98001, 1900)" in the SqlCommand property field. If you want to use the result as an input column
to the next component, I recommend that you use OLE DB Source. If you want to use SSIS variables together with the T-
SQL statement, I recommend that you consider using Execute SQL Task together with your data flow task. You can refer to
the following articles:
Amazing SSIS: Parameters in Execute SQL Task
http://blogs.msdn.com/msdnts/archive...-sql-task.aspx
SSIS: Mapping parameter inside of a Execute SQL Task, OLE DB Source Component or Datareader component
http://rafael-salas.blogspot.com/200...inside-of.html

Hope this helps!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...#notifications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======





Reply With Quote
  #5  
Old   
Charles Wang [MSFT]
 
Posts: n/a

Default RE: Using SQLCLR function returning SqlDateTime in DataFlow - 09-19-2008 , 12:10 AM



Hi Mike,
Thank you for using Microsoft MSDN Managed Newsgroup.

Regarding your question, could you please elaborate your requirement so that we can better understand it and give out a
specific resolution?

There is no difference to use a normal UDF or a CLR UDF in OLE DB Command. You can simply input "SELECT
dbo.JulianToGregorian (98001, 1900)" in the SqlCommand property field. If you want to use the result as an input column
to the next component, I recommend that you use OLE DB Source. If you want to use SSIS variables together with the T-
SQL statement, I recommend that you consider using Execute SQL Task together with your data flow task. You can refer to
the following articles:
Amazing SSIS: Parameters in Execute SQL Task
http://blogs.msdn.com/msdnts/archive...-sql-task.aspx
SSIS: Mapping parameter inside of a Execute SQL Task, OLE DB Source Component or Datareader component
http://rafael-salas.blogspot.com/200...inside-of.html

Hope this helps!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...#notifications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======





Reply With Quote
  #6  
Old   
Charles Wang [MSFT]
 
Posts: n/a

Default RE: Using SQLCLR function returning SqlDateTime in DataFlow - 09-19-2008 , 12:10 AM



Hi Mike,
Thank you for using Microsoft MSDN Managed Newsgroup.

Regarding your question, could you please elaborate your requirement so that we can better understand it and give out a
specific resolution?

There is no difference to use a normal UDF or a CLR UDF in OLE DB Command. You can simply input "SELECT
dbo.JulianToGregorian (98001, 1900)" in the SqlCommand property field. If you want to use the result as an input column
to the next component, I recommend that you use OLE DB Source. If you want to use SSIS variables together with the T-
SQL statement, I recommend that you consider using Execute SQL Task together with your data flow task. You can refer to
the following articles:
Amazing SSIS: Parameters in Execute SQL Task
http://blogs.msdn.com/msdnts/archive...-sql-task.aspx
SSIS: Mapping parameter inside of a Execute SQL Task, OLE DB Source Component or Datareader component
http://rafael-salas.blogspot.com/200...inside-of.html

Hope this helps!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...#notifications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======





Reply With Quote
  #7  
Old   
Charles Wang [MSFT]
 
Posts: n/a

Default RE: Using SQLCLR function returning SqlDateTime in DataFlow - 09-19-2008 , 12:10 AM



Hi Mike,
Thank you for using Microsoft MSDN Managed Newsgroup.

Regarding your question, could you please elaborate your requirement so that we can better understand it and give out a
specific resolution?

There is no difference to use a normal UDF or a CLR UDF in OLE DB Command. You can simply input "SELECT
dbo.JulianToGregorian (98001, 1900)" in the SqlCommand property field. If you want to use the result as an input column
to the next component, I recommend that you use OLE DB Source. If you want to use SSIS variables together with the T-
SQL statement, I recommend that you consider using Execute SQL Task together with your data flow task. You can refer to
the following articles:
Amazing SSIS: Parameters in Execute SQL Task
http://blogs.msdn.com/msdnts/archive...-sql-task.aspx
SSIS: Mapping parameter inside of a Execute SQL Task, OLE DB Source Component or Datareader component
http://rafael-salas.blogspot.com/200...inside-of.html

Hope this helps!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...#notifications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======





Reply With Quote
  #8  
Old   
Charles Wang [MSFT]
 
Posts: n/a

Default RE: Using SQLCLR function returning SqlDateTime in DataFlow - 09-19-2008 , 12:10 AM



Hi Mike,
Thank you for using Microsoft MSDN Managed Newsgroup.

Regarding your question, could you please elaborate your requirement so that we can better understand it and give out a
specific resolution?

There is no difference to use a normal UDF or a CLR UDF in OLE DB Command. You can simply input "SELECT
dbo.JulianToGregorian (98001, 1900)" in the SqlCommand property field. If you want to use the result as an input column
to the next component, I recommend that you use OLE DB Source. If you want to use SSIS variables together with the T-
SQL statement, I recommend that you consider using Execute SQL Task together with your data flow task. You can refer to
the following articles:
Amazing SSIS: Parameters in Execute SQL Task
http://blogs.msdn.com/msdnts/archive...-sql-task.aspx
SSIS: Mapping parameter inside of a Execute SQL Task, OLE DB Source Component or Datareader component
http://rafael-salas.blogspot.com/200...inside-of.html

Hope this helps!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...#notifications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======





Reply With Quote
  #9  
Old   
Charles Wang [MSFT]
 
Posts: n/a

Default RE: Using SQLCLR function returning SqlDateTime in DataFlow - 09-19-2008 , 12:10 AM



Hi Mike,
Thank you for using Microsoft MSDN Managed Newsgroup.

Regarding your question, could you please elaborate your requirement so that we can better understand it and give out a
specific resolution?

There is no difference to use a normal UDF or a CLR UDF in OLE DB Command. You can simply input "SELECT
dbo.JulianToGregorian (98001, 1900)" in the SqlCommand property field. If you want to use the result as an input column
to the next component, I recommend that you use OLE DB Source. If you want to use SSIS variables together with the T-
SQL statement, I recommend that you consider using Execute SQL Task together with your data flow task. You can refer to
the following articles:
Amazing SSIS: Parameters in Execute SQL Task
http://blogs.msdn.com/msdnts/archive...-sql-task.aspx
SSIS: Mapping parameter inside of a Execute SQL Task, OLE DB Source Component or Datareader component
http://rafael-salas.blogspot.com/200...inside-of.html

Hope this helps!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...#notifications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======





Reply With Quote
  #10  
Old   
Mirek Endys
 
Posts: n/a

Default RE: Using SQLCLR function returning SqlDateTime in DataFlow - 09-19-2008 , 02:41 AM



Hello Charles.

The problem is, that I need replace or create new column in the row by the
tranformation that will use this function. For example: Im retrieving row
from the DB2 (AS400) database. In one column is date, that is represented as
Julian date (integer: 102154 = year 2002 and 154 day of the year). My SQL
function can transofrm this number to the SqlDateTime.

I need to create (Derive) new column on the fly (during datalfow) that will
be transformed by my function and will use the integer from the retrieved row.

Hope, this explain it is more clear.

Thanks for help

""Charles Wang [MSFT]"" wrote:

Quote:
Hi Mike,
Thank you for using Microsoft MSDN Managed Newsgroup.

Regarding your question, could you please elaborate your requirement so that we can better understand it and give out a
specific resolution?

There is no difference to use a normal UDF or a CLR UDF in OLE DB Command. You can simply input "SELECT
dbo.JulianToGregorian (98001, 1900)" in the SqlCommand property field. If you want to use the result as an input column
to the next component, I recommend that you use OLE DB Source. If you want to use SSIS variables together with the T-
SQL statement, I recommend that you consider using Execute SQL Task together with your data flow task. You can refer to
the following articles:
Amazing SSIS: Parameters in Execute SQL Task
http://blogs.msdn.com/msdnts/archive...-sql-task.aspx
SSIS: Mapping parameter inside of a Execute SQL Task, OLE DB Source Component or Datareader component
http://rafael-salas.blogspot.com/200...inside-of.html

Hope this helps!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...#notifications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======






Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.