dbTalk Databases Forums  

after INSERT fail, make UPDATE guidelines

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


Discuss after INSERT fail, make UPDATE guidelines in the microsoft.public.sqlserver.dts forum.



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

Default after INSERT fail, make UPDATE guidelines - 09-23-2008 , 02:35 AM






I think, that I have to do something wrong. In periodicaly running updates,
at the end of the transformation, I usually use OLE DB Destination and if the
INSERT fails (usually because of the PK conflict), row is redirected to the
error output and there the OLE DB Command make UPDATE of this row to the DB.

This technique working well, but!!! -> In the UPDATE command is not possible
use named parameters (I have to use UPDATE myTable SET column1 = ? WHERE
column2 = ?). In case I have tables with a few columns, that is no problem.
But I often transform data tables from the AS400 DB and there are 140 columns
with 8 primary keys and with only 8 characters in the column name. Which
means, it is very unclear (not well arranged). On one side I have columns
from AS400 DB2 named for example GLPMJ, GLGTGF, GLRUID, etc.. on other side
unnamed parameters Param_0, Param_1, Param_3. etc....

My questions are:
1) Is there way to use named parameters in the OLE DB Command?
2) Is there another way to perform update command based on keys in the
destination table??

Thanks alot for the help.

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

Default RE: after INSERT fail, make UPDATE guidelines - 09-23-2008 , 04:44 AM






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

By design OLE DB does not accept named parameters. However if your intention is to recognize which column for each parameter it represents, you can create a stored procedure in your SQL
Server database. Once you set the SqlCommand text as "exec proc_name ?,?,...", you can find that the Destination Columns are automatically displayed as the parameters names of the
stored procedure. If you create meaningful parameters names for your stored procedure, you can get meaningful parameter names in your OLE DB Command.

So regarding your two questions:
1) Is there way to use named parameters in the OLE DB Command?
Yes, by using a stored procedure.

2) Is there another way to perform update command based on keys in the destination table??
Yes, by using a stored procedure.

Hope this helps. If there is anything unclear, please feel free to let me know.

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: after INSERT fail, make UPDATE guidelines - 09-23-2008 , 04:44 AM



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

By design OLE DB does not accept named parameters. However if your intention is to recognize which column for each parameter it represents, you can create a stored procedure in your SQL
Server database. Once you set the SqlCommand text as "exec proc_name ?,?,...", you can find that the Destination Columns are automatically displayed as the parameters names of the
stored procedure. If you create meaningful parameters names for your stored procedure, you can get meaningful parameter names in your OLE DB Command.

So regarding your two questions:
1) Is there way to use named parameters in the OLE DB Command?
Yes, by using a stored procedure.

2) Is there another way to perform update command based on keys in the destination table??
Yes, by using a stored procedure.

Hope this helps. If there is anything unclear, please feel free to let me know.

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: after INSERT fail, make UPDATE guidelines - 09-23-2008 , 04:44 AM



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

By design OLE DB does not accept named parameters. However if your intention is to recognize which column for each parameter it represents, you can create a stored procedure in your SQL
Server database. Once you set the SqlCommand text as "exec proc_name ?,?,...", you can find that the Destination Columns are automatically displayed as the parameters names of the
stored procedure. If you create meaningful parameters names for your stored procedure, you can get meaningful parameter names in your OLE DB Command.

So regarding your two questions:
1) Is there way to use named parameters in the OLE DB Command?
Yes, by using a stored procedure.

2) Is there another way to perform update command based on keys in the destination table??
Yes, by using a stored procedure.

Hope this helps. If there is anything unclear, please feel free to let me know.

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: after INSERT fail, make UPDATE guidelines - 09-23-2008 , 04:44 AM



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

By design OLE DB does not accept named parameters. However if your intention is to recognize which column for each parameter it represents, you can create a stored procedure in your SQL
Server database. Once you set the SqlCommand text as "exec proc_name ?,?,...", you can find that the Destination Columns are automatically displayed as the parameters names of the
stored procedure. If you create meaningful parameters names for your stored procedure, you can get meaningful parameter names in your OLE DB Command.

So regarding your two questions:
1) Is there way to use named parameters in the OLE DB Command?
Yes, by using a stored procedure.

2) Is there another way to perform update command based on keys in the destination table??
Yes, by using a stored procedure.

Hope this helps. If there is anything unclear, please feel free to let me know.

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: after INSERT fail, make UPDATE guidelines - 09-23-2008 , 04:44 AM



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

By design OLE DB does not accept named parameters. However if your intention is to recognize which column for each parameter it represents, you can create a stored procedure in your SQL
Server database. Once you set the SqlCommand text as "exec proc_name ?,?,...", you can find that the Destination Columns are automatically displayed as the parameters names of the
stored procedure. If you create meaningful parameters names for your stored procedure, you can get meaningful parameter names in your OLE DB Command.

So regarding your two questions:
1) Is there way to use named parameters in the OLE DB Command?
Yes, by using a stored procedure.

2) Is there another way to perform update command based on keys in the destination table??
Yes, by using a stored procedure.

Hope this helps. If there is anything unclear, please feel free to let me know.

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: after INSERT fail, make UPDATE guidelines - 09-23-2008 , 04:44 AM



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

By design OLE DB does not accept named parameters. However if your intention is to recognize which column for each parameter it represents, you can create a stored procedure in your SQL
Server database. Once you set the SqlCommand text as "exec proc_name ?,?,...", you can find that the Destination Columns are automatically displayed as the parameters names of the
stored procedure. If you create meaningful parameters names for your stored procedure, you can get meaningful parameter names in your OLE DB Command.

So regarding your two questions:
1) Is there way to use named parameters in the OLE DB Command?
Yes, by using a stored procedure.

2) Is there another way to perform update command based on keys in the destination table??
Yes, by using a stored procedure.

Hope this helps. If there is anything unclear, please feel free to let me know.

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: after INSERT fail, make UPDATE guidelines - 09-23-2008 , 04:44 AM



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

By design OLE DB does not accept named parameters. However if your intention is to recognize which column for each parameter it represents, you can create a stored procedure in your SQL
Server database. Once you set the SqlCommand text as "exec proc_name ?,?,...", you can find that the Destination Columns are automatically displayed as the parameters names of the
stored procedure. If you create meaningful parameters names for your stored procedure, you can get meaningful parameter names in your OLE DB Command.

So regarding your two questions:
1) Is there way to use named parameters in the OLE DB Command?
Yes, by using a stored procedure.

2) Is there another way to perform update command based on keys in the destination table??
Yes, by using a stored procedure.

Hope this helps. If there is anything unclear, please feel free to let me know.

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: after INSERT fail, make UPDATE guidelines - 09-23-2008 , 04:44 AM



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

By design OLE DB does not accept named parameters. However if your intention is to recognize which column for each parameter it represents, you can create a stored procedure in your SQL
Server database. Once you set the SqlCommand text as "exec proc_name ?,?,...", you can find that the Destination Columns are automatically displayed as the parameters names of the
stored procedure. If you create meaningful parameters names for your stored procedure, you can get meaningful parameter names in your OLE DB Command.

So regarding your two questions:
1) Is there way to use named parameters in the OLE DB Command?
Yes, by using a stored procedure.

2) Is there another way to perform update command based on keys in the destination table??
Yes, by using a stored procedure.

Hope this helps. If there is anything unclear, please feel free to let me know.

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   
Charles Wang [MSFT]
 
Posts: n/a

Default RE: after INSERT fail, make UPDATE guidelines - 09-25-2008 , 10:00 AM



Hi Mike,
What is everything going on regarding this issue? Please feel free to drop me a note at your convenient.

Thank you!

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.
================================================== =======
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.