How to Write Atomic Transactions in .NET
page 2 of 7
by Keyvan Nayyeri
Average Rating: 
Views (Total / Last 10 Days): 37355/ 39

Prepare Database

To write my sample, I created a simple table with three columns:

·         id (int)

·         Name (navarchar)

·         Value (int)

Consider each row is an account in a bank.  Next, I created a stored procedure to add a value to a specific account.

Listing 1

    @id int,
    @value int
    UPDATE dbo.MyTable
    SET Value = (Value + @value)
    WHERE id= @id

To finish preparing my database, I added a sample account to my table.

Figure 1

View Entire Article

User Comments

Title: ASAS   
Name: ASAS
Date: 2012-08-01 7:53:47 AM
Title: Very Gud   
Name: Soby
Date: 2007-06-09 7:26:03 AM
This is very Help for me

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-06-17 6:20:36 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search