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

Author  Topic 

Delinda
Constraint Violating Yak Guru

315 Posts

Posted - 2009-12-12 : 19:43:34
My SQL as follow,

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')

It's possible, the RowID value equal to 0x0000000000000000 after insert or update statement?

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-12-12 : 19:56:10
I have read that rowversion is a synonym for timestamp.
So I don't believe it can be 0x0000000000000000 because it is the increasing database timestamp.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Delinda
Constraint Violating Yak Guru

315 Posts

Posted - 2009-12-12 : 20:37:29
quote:
Originally posted by webfred

I have read that rowversion is a synonym for timestamp.
So I don't believe it can be 0x0000000000000000 because it is the increasing database timestamp.


No, you're never too old to Yak'n'Roll if you're too young to die.



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

Did SQL 1 and SQL 2 same? I convert RowVersion to BigInt because i want to make it front-end (ASP.NET) can read it easily.
Go to Top of Page
   

- Advertisement -