2

From the various info I have read about fn_dblog() in MS-SQL, I thought that AllocUnitName contained the table name. But recently, I was checking for deletion of a specific table's row but could not find its name in the results returned by fn_dblog(null,null). There are rows that have dbo.MyTable.PK_xxxx but nothing with just dbo.MyTable. This is a table that has tens of transactions daily so I am wondering if AllocUnitName is the correct place to look for the table name. I am using MS-SQL 2008 R2 here.

So, if AllocUnitName is not the right place to look, where should I look in the results returned by fn_dblog(null,null) to get records specific to a specific table.

Pondlife
  • 15,992
  • 6
  • 37
  • 51
unubar
  • 416
  • 6
  • 15

1 Answers1

0

The short answer is, who knows? fn_dblog() is not documented or supported, so it's impossible to say what the information it returns really means.

Having said that, I guess that db.MyTable.PK_xxxx is the primary key of the table, and since by default PKs are clustered and the clustered index contains the table data, it is the table in a certain sense. Therefore I would assume that AllocUnitName is indeed what you want, but using undocumented system procedures is always at your own risk and you should not expect any guaranteed answers.

Pondlife
  • 15,992
  • 6
  • 37
  • 51
  • 2
    Yes, they are not documented but they are not a secret either. The SQL dev team themselves blog about it. Paul Randal explained here why they are not documented: http://www.sqlskills.com/blogs/paul/post/Why-are-so-many-DBCC-commands-undocumented.aspx I will check if AllocUnitName used the primary key as you have suggested. – unubar Nov 23 '12 at 16:10