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 2005 Forums
 Transact-SQL (2005)
 Database Lost

Author  Topic 

wgsing
Starting Member

11 Posts

Posted - 2009-08-20 : 22:00:15
Hi All,
I here facing a big problem. Situation is somethings like this. When the user using my system update the record on Jan 2009.Eg. Update the issued date as that day. The system can show the date issued out. But when 3 - 4 month later, system will automatic rollback. That means as issued date on that record is automatic set it to Null. For this case not every record effected, only for few record. My system don't have the rollback function.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-08-20 : 22:53:50
check all your query that update to that table. Probably one of them set it back to NULL.


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

wgsing
Starting Member

11 Posts

Posted - 2009-08-20 : 23:18:52
But why the database set it back to Null after few month later not immediately? Please advise
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-08-20 : 23:23:52
i don't know.

Unless you have a BEGIN TRAN without COMMIT, when the connection terminates, the changes will get ROLLBACK. But if you do have this, other user will not be able to access to that table, it will be blocked. So this is less likely.

You can use the SQL Server Profiler to monitor this but 3 - 4 months might not be practical.

or you can setup an audit trail table to audit the changes on that table using triggers. At least that will tell you who and when that occurs.

Best bet is still go through your application query and check any portion of the code that might update that to NULL.


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

waterduck
Aged Yak Warrior

982 Posts

Posted - 2009-08-20 : 23:37:19
virus attack?H1N1!!!
ps. i mean sql injection


Hope can help...but advise to wait pros with confirmation...
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-08-21 : 00:03:04


thank goodness it is not bird flu, else we have to put you away.


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

wgsing
Starting Member

11 Posts

Posted - 2009-08-21 : 04:15:18
Hi Khtan,
Thanks for you sharing and advise. I already check my coding all the begin tran have commit when end of transaction. Is very weird that when user update the field on the within 2 - 3 month, system show updated date as that day date. But when after that period, system show updated date as Null.
Go to Top of Page
   

- Advertisement -