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
 SQL Server 2012 Forums
 Transact-SQL (2012)
 SQL Service restarted when update is in progress

Author  Topic 

govthamb
Starting Member

27 Posts

Posted - 2013-02-20 : 04:55:59
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
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-02-20 : 08:43:28
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
   

- Advertisement -