Click here to Skip to main content
15,921,793 members
Home / Discussions / Database
   

Database

 
QuestionUsing OleDbReader.GetString to Retrieve Strings over 200 characters Pin
Nigel Cudjoe22-Jun-07 7:50
Nigel Cudjoe22-Jun-07 7:50 
QuestionSQL Server 2008 Pin
Brendan Vogt22-Jun-07 6:17
Brendan Vogt22-Jun-07 6:17 
AnswerRe: SQL Server 2008 Pin
Mike Dimmick23-Jun-07 1:37
Mike Dimmick23-Jun-07 1:37 
AnswerRe: SQL Server 2008 Pin
zhousz23-Jun-07 23:36
zhousz23-Jun-07 23:36 
GeneralRe: SQL Server 2008 Pin
Colin Angus Mackay24-Jun-07 2:24
Colin Angus Mackay24-Jun-07 2:24 
QuestionDatabase Architecture:Record Locking Pin
xbiplav22-Jun-07 4:59
xbiplav22-Jun-07 4:59 
AnswerRe: Database Architecture:Record Locking Pin
Pete O'Hanlon22-Jun-07 9:56
mvePete O'Hanlon22-Jun-07 9:56 
AnswerRe: Database Architecture:Record Locking Pin
Mike Dimmick23-Jun-07 2:03
Mike Dimmick23-Jun-07 2:03 
SQL Server automatically ensures that data modification statements (INSERT, UPDATE, DELETE) are atomic - a statement that affects multiple rows will either modify all of them, or none (if some error occurs, the partial changes will be rolled back).

If you need to execute multiple statements in the same logical operation, and have the results consistent, you can use a transaction. If submitting all the statements in a single batch, or in a stored procedure, you can use the BEGIN TRANSACTION/COMMIT TRANSACTION/ROLLBACK TRANSACTION statements. If you can't execute it all in one batch, or need to call multiple stored procedures, use a client-side transaction (e.g. SqlConnection.CreateTransaction in .NET languages)

There are a number of transaction isolation levels which control which updates from other users can appear between two SELECT statements in the same transaction. Basically, READ COMMITTED (the default) allows changes to be made between two SELECTs - the second statement may see results that another, completed, transaction has made. REPEATABLE READ prevents updates and deletes until your transaction is committed. SERIALIZABLE also prevents inserts that would change your resultset.

Transactions using the built-in transaction features should be kept short. Holding a transaction open for too long prevents other users getting work done. If you need your application to allow users to read a record, make changes to it over a period of time, then eventually commit the change, you need to either come up with a manual record-locking scheme, or somehow check to see if changes have been made since the data was read and either automatically merge the changes made by each user or simply alert the user that the database has been changed.

One of the simplest ways to detect that the data has changed since being read is to use a rowversion column, which changes every time the row is updated.

Stability. What an interesting concept. -- Chris Maunder

QuestionPlz solve this query Pin
Care Career22-Jun-07 3:31
Care Career22-Jun-07 3:31 
AnswerRe: Plz solve this query Pin
Blue_Boy22-Jun-07 3:41
Blue_Boy22-Jun-07 3:41 
GeneralRe: Plz solve this query Pin
AlexeiXX322-Jun-07 9:05
AlexeiXX322-Jun-07 9:05 
AnswerRe: Plz solve this query Pin
Krish - KP22-Jun-07 14:26
Krish - KP22-Jun-07 14:26 
GeneralRe: Plz solve this query Pin
Colin Angus Mackay24-Jun-07 2:27
Colin Angus Mackay24-Jun-07 2:27 
Questionuser sql server Pin
WhiteGirl2322-Jun-07 1:10
WhiteGirl2322-Jun-07 1:10 
AnswerRe: user sql server Pin
kubben22-Jun-07 1:56
kubben22-Jun-07 1:56 
AnswerRe: user sql server Pin
Mike Dimmick23-Jun-07 2:20
Mike Dimmick23-Jun-07 2:20 
GeneralRe: user sql server Pin
WhiteGirl2324-Jun-07 19:48
WhiteGirl2324-Jun-07 19:48 
Questiondatabas query question Pin
samtam21-Jun-07 23:09
samtam21-Jun-07 23:09 
AnswerRe: databas query question Pin
andyharman22-Jun-07 0:39
professionalandyharman22-Jun-07 0:39 
Questionuser sql server Pin
WhiteGirl2321-Jun-07 22:37
WhiteGirl2321-Jun-07 22:37 
AnswerRe: user sql server Pin
originSH21-Jun-07 22:57
originSH21-Jun-07 22:57 
QuestionRemoving Redundant enteries for a Table?? Pin
granshah @ eVisionISF21-Jun-07 21:22
granshah @ eVisionISF21-Jun-07 21:22 
AnswerRe: Removing Redundant enteries for a Table?? Pin
Krish - KP21-Jun-07 21:44
Krish - KP21-Jun-07 21:44 
QuestionSQL Server Authentication Pin
UNIQUE MUSKAN21-Jun-07 21:14
UNIQUE MUSKAN21-Jun-07 21:14 
QuestionRe: SQL Server Authentication Pin
Sylvester george21-Jun-07 21:22
Sylvester george21-Jun-07 21:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.