Re: invert tinyint column

From: Vishal Parkar (REMOVE_THIS_vgparkar_at_yahoo.co.in)
Date: 10/08/04


Date: Fri, 8 Oct 2004 19:33:47 +0530

try following sequence of update statements:

begin transaction
update <table> set col_1 = 2
where col_1 = 1
update <table> set col_1 = 1
where col_1 = 0
update <table> set col_1 = 0
where col_1 = 2

--check the data and issue commit/rollback accordingly.

-- 
Vishal Parkar
vgparkar@yahoo.co.in | vgparkar@hotmail.com


Relevant Pages

  • RE: CommitBatchSize vs. CommitBatchThreshold for transactional dis
    ... " I issued the same 7 update statements as in test 1. ... saw one batch with 6 update statements (all with the same transaction ... ID) followed by a second batch with 1 update statement (different ... commitbatchthreshold would as its 11 commands. ...
    (microsoft.public.sqlserver.replication)
  • Re: How to generate unique document number ?
    ... Do not use the cache on a sequence. ... transaction, or an error may occur, causing the transaction to ... By creating an autonomous transaction - still possible to ... get missing numbers. ...
    (comp.databases.oracle.server)
  • Re: Deadlock on an identity field table
    ... Thanks David, that changed us from 90% transaction failure on 16 threads to ... 1280 transactions a minute on the same thread count with no sequence problems ... >> The result is used to provide unique keys for multiple tables. ...
    (microsoft.public.sqlserver.programming)
  • Re: Table Locking in .NET Transaction
    ... can lead to major performance problems. ... have no problems with gaps in the sequence, use a table with an identity ... > number table as part of a larger transaction taking care ... I plan on using a Holdlock ...
    (microsoft.public.sqlserver.programming)
  • Re: Want to write your SQL statements and even stored procedures in pure C#?
    ... >> fields use an internal sequence but in general ... but identity fields cannot be obtained until ... > or even transaction begins. ... CustomerEntity newCustomer = new CustomerEntity; ...
    (microsoft.public.dotnet.framework.adonet)