Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Conversion problems in SQL Server 2008 R2

Author  Topic 

Hans80
Starting Member

10 Posts

Posted - 2011-12-08 : 05:11:27
Case:

1) Source table with a column rowversion with data type TIMESTAMP
2) Target table with a column rwoversion with data type BINARY(8)

I want to load only the new and updated records from the source table into the target table, based on the rowversion.

Somehow, I can only save the max(rowversion) from the target table as a STRING in a variable with following code:

SELECT CONVERT(VARCHAR,MAX(ROWV),1) AS rowversion
FROM Target_table

This code is giving me the correct output in the debugger.

In the next step (OLD DB source editor), I want to compare the max(rowversion) from the target table with the rowversion in the source table in order to give me only the new and updated records. But I compare now a data type TIMESTAMP with a data type STRING. How can I solve this... I don't see the solution...

I'm working with SQL Server 2008 R2.

Thanks


visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-12-08 : 07:07:31
same as


http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=168785

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -