I need to be able to compare Rowversion to be able to detect data changes for an ETL process. I am using SQL Server 2005. The process needs to convert to varchar for comparison. I have trawled the net for some suggestions but I think there is a problem with case sensitivity:
When I run select min_active_rowversion() this is retuned - 0x0000000002514EB9
When I run SELECT sys.fn_sqlvarbasetostr(min_active_rowversion())
or
SELECT master.dbo.fn_varbintohexstr(min_active_rowversion())
0x0000000002514eb9 is returned which is a different value to that returned by min_active_rowversion()
Is there a process that I can use to be able to return the value of min_active_rowversion() as a varchar?
Many thanks
Microsoft SQL ServerMicrosoft SQL Server 2005SQL
Last Comment
Raja Jegan R
8/22/2022 - Mon
Scott Pletcher
I would think you could cast it to a bigint, and then cast the bigint to char(19+)/varchar(19+).
And vice-versa to reconvert.
For example:
declare @rowversion rowversion
set @rowversion = 0x0000000002514EB9
select cast(cast(@rowversion as bigint) as varchar(19))
select cast(cast(cast(cast(@rowversion as bigint) as varchar(19)) as bigint) as rowversion)
And vice-versa to reconvert.
For example:
declare @rowversion rowversion
set @rowversion = 0x0000000002514EB9
select cast(cast(@rowversion as bigint) as varchar(19))
select cast(cast(cast(cast(@rowve