Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL Statement Example

Author  Topic 

sql_newbie121
Yak Posting Veteran

52 Posts

Posted - 2010-02-03 : 12:28:19
Hi all:

I need an example of SQL statements that shows how transactions will be synchronized when the data is updated in the database?

Thanks for your help.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-02-03 : 20:40:31
I don't quite understand what you are asking. Could you be more detailed?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

sql_newbie121
Yak Posting Veteran

52 Posts

Posted - 2010-02-09 : 14:55:42
Well, i do not know how to ask you but let me try. In any database transaction, how can we make sure that data is in synchronized state or in a consistent state with examples. Let me know if you are not understainding it yet.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-02-09 : 15:10:08
Not sure I am understanding the question, but if I have understood the question: that is guaranteed by an RDMS

If you say

BEGIN TRANSACTION

UPDATE Table1 SET Col1 = 'FOO' WHERE Col2 = 'BAR'

UPDATE Table2 SET Col3 = 'BAR' WHERE Col4 = 'FOO'

COMMIT

then it is guaranteed that either a) both updates have happened, or b) Neither of the two updates has happened
Go to Top of Page

sql_newbie121
Yak Posting Veteran

52 Posts

Posted - 2010-02-09 : 15:14:10
Thanks Kristen. It helped.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-02-09 : 15:21:28
Pleasure
Go to Top of Page
   

- Advertisement -