SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 SQL Service restarted when update is in progress
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

govthamb
Starting Member

India
27 Posts

Posted - 02/20/2013 :  04:55:59  Show Profile  Reply with Quote
Hi All,

I have a scenario in SQL Server and needs your help to get the necessary information.

1. Open SQL Analyzer.
2. Directly using a query updating 40000 records in a table in TEST db (no Begin transaction started), query started @ 11:30 hrs and running.
3. SQL Service got restarted @ 11:31 hrs.

Now, user wants to check the following:

1. Whether the table is updated with records or not.
2. If updated, how many records are updated in that table and how many missed.
3. Will there be any rollback/roll forward

Note:- There is no date time stamp column available in the table.

Thanks in advance.

James K
Flowing Fount of Yak Knowledge

3583 Posts

Posted - 02/20/2013 :  08:43:28  Show Profile  Reply with Quote
To answer your first and second questions:

If it was a single statement, either all the changes would have been committed, or none would be. So either all the records that should have been affected would be or none would be affected.

Regarding the third question:

If the changes were committed, and if the data was not persisted to the data file(s), SQL server would do a roll forward, otherwise it will do a rollback when you restart the server. All of that should be transparent to you unless there was data or log file got corrupted.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000