I have a query about transaction logs regarding sql server 2005-08. When is a transaction written to the transaction log. Is it written the the data file before its written to the log file or is it written to the log file first before its commited to the database.
Thanks
It is written to the log file first. This principle is called Write Ahead Logging.
If the opposite was to occur and data was written to the data file before the log there would be no way to recover from a crash reliably.