Sqlserver
 sql >> Base de Dados >  >> RDS >> Sqlserver

Como exibir logs de transações no SQL Server 2008


Você poderia usar o indocumentado
DBCC LOG(databasename, typeofoutput)

onde typeofoutput:
0: Return only the minimum of information for each operation -- the operation, its context and the transaction ID. (Default)
1: As 0, but also retrieve any flags and the log record length.
2: As 1, but also retrieve the object name, index name, page ID and slot ID.
3: Full informational dump of each operation.
4: As 3 but includes a hex dump of the current transaction log row.

Por exemplo, DBCC LOG(banco de dados, 1)

Você também pode tentar fn_dblog.

Para reverter uma transação usando o log de transações, dê uma olhada na postagem do Stack Overflow Rollback transaction using transaction log .