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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Question about RowVersion Data Type -Part 2

Author  Topic 

Delinda
Constraint Violating Yak Guru

315 Posts

Posted - 2009-12-14 : 01:27:47
From my SQL statement,
declare @tEmployee table
(
TrnxID int primary key identity(1,1),
Nme varchar(100),
RowID rowversion
)
insert into @tEmployee(Nme) values('Mike Tyson')
insert into @tEmployee(Nme) values('Hollyfield')

SQL 1 - select * from @tEmployee
the result as follow,
1 Mike Tyson 0x00000000000007FA
2 Hollyfield 0x00000000000007FB

SQL 2 - select TrnxID,Nme,cast(RowID as BigInt) from @tEmployee
the result as follow,
1 Mike Tyson 2042
2 Hollyfield 2043

My question, is that SQL 1 and SQL 2 is equal?

I convert RowVersion to BigInt because i want to make it my front-end (ASP.NET) can read it easily.
   

- Advertisement -