SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Checking for updated rows


Checking for updated rows

Author
Message
dwilliscp
dwilliscp
SSC Eights!
SSC Eights! (804 reputation)SSC Eights! (804 reputation)SSC Eights! (804 reputation)SSC Eights! (804 reputation)SSC Eights! (804 reputation)SSC Eights! (804 reputation)SSC Eights! (804 reputation)SSC Eights! (804 reputation)

Group: General Forum Members
Points: 804 Visits: 775
In Andy Leonard's article "Adding Rows in Incremental Loads - Level 3 of the Stairway to Integration Services" he goes over adding 'Lookup' object and checking for modified rows. I decided to do some training... using our data.. and it generated an error due to the data type, in my table, was real. So just how do we test to see if the data has changed if we have a column that is real? Why will it not work on real data?

The error...

TITLE: Microsoft Visual Studio
------------------------------

Cannot map the lookup column, 'New_Safety_Stock', because the column is set to a floating point data type.

------------------------------
BUTTONS:

OK
------------------------------
Phil Parkin
Phil Parkin
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18169 Visits: 20392
dwilliscp (2/11/2013)
In Andy Leonard's article "Adding Rows in Incremental Loads - Level 3 of the Stairway to Integration Services" he goes over adding 'Lookup' object and checking for modified rows. I decided to do some training... using our data.. and it generated an error due to the data type, in my table, was real. So just how do we test to see if the data has changed if we have a column that is real? Why will it not work on real data?

The error...

TITLE: Microsoft Visual Studio
------------------------------

Cannot map the lookup column, 'New_Safety_Stock', because the column is set to a floating point data type.

------------------------------
BUTTONS:

OK
------------------------------


You usually do a lookup on the PK of your table. Andy's article suggests something similar, I think: check whether a matching row exists (match on PK) - if it does, update it, otherwise, insert it.

What the article does not do is check individual columns to see whether they have changed.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
dwilliscp
dwilliscp
SSC Eights!
SSC Eights! (804 reputation)SSC Eights! (804 reputation)SSC Eights! (804 reputation)SSC Eights! (804 reputation)SSC Eights! (804 reputation)SSC Eights! (804 reputation)SSC Eights! (804 reputation)SSC Eights! (804 reputation)

Group: General Forum Members
Points: 804 Visits: 775
I changed to PK, thanks. I will have to look back and see if he stated anything about using PK... I would not think that e-mail would be a PK, since folks tend to have more than one.
Phil Parkin
Phil Parkin
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18169 Visits: 20392
dwilliscp (2/11/2013)
I changed to PK, thanks. I will have to look back and see if he stated anything about using PK... I would not think that e-mail would be a PK, since folks tend to have more than one.


I will agree with that - but he does state that he has decided to match the first one he finds and update just that one row. In a way, that makes the e-mail column in the example effectively a PK.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search