1、查看数据库id:

sp_helpdb


2、DBCC log ( {dbid|dbname}, [, type={0|1|2|3|4}] )   

参数: 

 Dbid or dbname - 任一数据库的ID或名字  type - 输出结果的类型: 

 0 - 最少信息(operation, context, transaction id)   

 1 - 更多信息(plus flags, tags, row length) 

 2 - 非常详细的信息(plus object name, index name,page id, slot id)   

 3 - 每种操作的全部信息 

 4 - 每种操作的全部信息加上该事务的16进制信息  默认 type = 0



测试:


sp_helpdb ;


命令输出结果:


4000125135db  8


dbcc log(8,0);


命令输出结果:


00000041:00000160:0001 LOP_BEGIN_CKPT LCX_NULL 0000:00000000 0