• I'm seeing something interesting, and was wondering if someone can tell me what's going on. As an experiment to see what would appear in the log, I modify a table called PhoneList to add one character to a name field and I see the following sequence in my audit table:

    17 ALTER TABLE dbo.PhoneList DROP CONSTRAINT FK_...

    18 CREATE TABLE dbo.Tmp_PhoneList ...

    19 GRANT SELECT on dbo.Tmp_PhoneList To Public as dbo

    20 DROP TABLE dbo.PhoneList

    21 CREATE CLUSTERED INDEX IX_PhoneList ON dbo.PhoneList ...

    22 ALTER TABLE dbo.PhoneList ADD CONSTRAINT FK_...

    23 CREATE TRIGGER tr_PhoneList ON dbo.PhoneList FOR ...

    There has to be an implied 20.5 where the Tmp_PhoneList table is renamed to PhoneList, but the trigger doesn't catch it.

    Another interesting thing is the dialog box in SSMS is saying that it will be saving the table referenced in the FK, but the trigger is not catching that. I'm assuming there that SSMS is initially thinking that the FK table needs to be saved, but when it comes time to run the query, the database engine realizes that it doesn't have to be and doesn't do anything.

    Any thoughts about the missing rename? Is somehow the audit trigger missing it?

    -----
    [font="Arial"]Knowledge is of two kinds. We know a subject ourselves or we know where we can find information upon it. --Samuel Johnson[/font]