Re: How to handle concurrency issue with better performance?
- From: "Jim Rand" <jimrand@xxxxxxxxxxxxx>
- Date: Sat, 31 Mar 2007 08:32:13 -0400
Timestamps are great. Cast them as integers and use them in the where
clause.
------------
StatusLookup
------------
SELECT StatusLookupID, Status, Office, EndUser, Consultant,
ConsultantOffice, LastUpdated, LastUpdatedBy, CAST(TS AS INT) AS TS FROM
AgencyNET.StatusLookup
INSERT INTO [AgencyNET].[StatusLookup] ([Status], [Office], [EndUser],
[Consultant], [ConsultantOffice], [LastUpdatedBy]) VALUES (@Status, @Office,
@EndUser, @Consultant, @ConsultantOffice, @LastUpdatedBy);SELECT
StatusLookupID, CAST(TS AS INT) AS TS FROM AgencyNET.StatusLookup WHERE
(StatusLookupID = SCOPE_IDENTITY())
UPDATE [AgencyNET].[StatusLookup] SET [Status] = @Status, [Office] =
@Office, [EndUser] = @EndUser, [Consultant] = @Consultant,
[ConsultantOffice] = @ConsultantOffice, [LastUpdated] = getutcdate(),
[LastUpdatedBy] = @LastUpdatedBy WHERE (([StatusLookupID] =
@Original_StatusLookupID) AND (CAST(TS AS INT) = @Original_TS));SELECT
CAST(TS AS INT) AS TS FROM AgencyNET.StatusLookup WHERE (StatusLookupID =
@StatusLookupID)
DELETE FROM [AgencyNET].[StatusLookup] WHERE (([StatusLookupID] =
@Original_StatusLookupID) AND (CAST(TS AS INT) = @Original_TS))
.
- References:
- How to handle concurrency issue with better performance?
- From: cherry
- Re: How to handle concurrency issue with better performance?
- From: William \(Bill\) Vaughn
- Re: How to handle concurrency issue with better performance?
- From: RobinS
- Re: How to handle concurrency issue with better performance?
- From: cherry
- Re: How to handle concurrency issue with better performance?
- From: William \(Bill\) Vaughn
- Re: How to handle concurrency issue with better performance?
- From: cherry
- How to handle concurrency issue with better performance?
- Prev by Date: Re: How to handle concurrency issue with better performance?
- Next by Date: Re: Deployable SQL Server authentication for ASP.NET
- Previous by thread: Re: How to handle concurrency issue with better performance?
- Next by thread: RE: Oracle 10g and OracleClient .Net 1.0/1.1
- Index(es):