Using a Table with a rowversion Column : rowversion « Query « SQL Server / T-SQL Tutorial

Home
SQL Server / T-SQL Tutorial
1.Query
2.Insert Delete Update
3.Table
4.Table Join
5.Data Types
6.Set Operations
7.Constraints
8.Subquery
9.Aggregate Functions
10.Date Functions
11.Math Functions
12.String Functions
13.Data Convert Functions
14.Analytical Functions
15.Sequence Indentity
16.View
17.Index
18.Cursor
19.Database
20.Transact SQL
21.Procedure Function
22.Trigger
23.Transaction
24.XML
25.System Functions
26.System Settings
27.System Tables Views
28.User Role
29.CLR
SQL Server / T-SQL Tutorial » Query » rowversion 
1.32.1.Using a Table with a rowversion Column
3CREATE TABLE MyTable(
4>   DataValue int        NOT NULL,
5>   RowVer    rowversion NOT NULL
6)
7> GO
1INSERT MyTable (DataValueVALUES (1)
2INSERT MyTable (DataValueVALUES (2)
3INSERT MyTable (DataValueVALUES (3)
4INSERT MyTable (DataValueVALUES (4)
5> GO

(rows affected)

(rows affected)

(rows affected)

(rows affected)
1UPDATE MyTable
2> SET
3>   DataValue = 10
4WHERE
5>   DataValue = 3
6> GO

(rows affected)
1SELECT
2>   *
3FROM
4>   MyTable
5> GO
DataValue   RowVer




----------- ------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
----------------------------------------------
          1 0x0000000000000FB0




          2 0x0000000000000FB1




         10 0x0000000000000FB4




          4 0x0000000000000FB3





(rows affected)
1>
2> drop table MyTable
3> GO
1.32.rowversion
1.32.1.Using a Table with a rowversion Column
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.