What about the Sql transaction log

Posted by Michel on Stack Overflow See other posts from Stack Overflow or by Michel
Published on 2010-03-31T19:42:16Z Indexed on 2010/04/01 5:43 UTC
Read the original article Hit count: 225

Filed under:

Hi,

i always thought that the sql transaction log keeps track of all the transactions done in the database so it could help recovering the database file in case of a unexpected power down or something like that So then, in normal usage, when the data is committed and written to disk, it is cleared because all the data is nice and safe in the mdf file. Seeing the ldf file grow and reading some i understand that that is not the case, and it will keep growing, until: you shrink the log. Only at that point all the commited transactions are cleared and the log file is shrinked. I found some sp's who should do this, but also found the theory that you first have to backup the database? That last step doesn't make sense to me, so can anyone tell me of that is correct and if so, why that is?

© Stack Overflow or respective owner

Related posts about sql-server