The ability to edit a database by multiple users is essential.
SELECT
customer_nm,
customer_nm AS customer_nm_orig
FROM demo_customer
WHERE customer_id = @p_customer_id
UPDATE demo_customer
SET customer_nm = @p_customer_name_new
WHERE customer_id = @p_customer_id
AND customer_name = @p_customer_nm_old
IF @@ROWCOUNT = 0
RAISERROR( "Update failed: Data changed" );
Tags: database sql-server
Source: By Swinders as answer to the question
This code snippet was collected from stackoverflow, and is licensed under CC BY-SA 2.5
Related code-snippets:
- Binary data in MySQL.
- What is a change to SQL Server tables?
- Flat file databases are generally stored in a computer hard drive. Flat file databases cannot be shared by any party with another.
- How do I upgrade my SQL Server database version?
- What is the best implementation of MySQL for SQL Server 2005?
- How do you iterate over a result set of data?
- How do you swap unique indexed column values in database?
- If a.net Embedded Database runs on a network. Embedded Database can run off a network.
- What is the best way to use a database in c#?
- How is database indexing used?
- How do I index database columns?
- How do you copy a data base?
- How do I unit test persistence?
- Convert HashBytes to VarChart?
- How do I divide a string so I can access item x?