Wednesday, March 7, 2012

Audit Info

Is there a way I can find out what things were changed on a table, like new
PK were created or dropped as well as constraints added/deleted?
TIAThere is some information from system tables that will show you dates when
objects where created. Not everything.

> Is there a way I can find out what things were changed on a table, like
> new
> PK were created or dropped as well as constraints added/deleted?
> TIA
new|||Vai2000 wrote:
> Is there a way I can find out what things were changed on a table,
> like new PK were created or dropped as well as constraints
> added/deleted?
> TIA
You can use DDL Triggers in SQL Server 2005.
David Gugick
Quest Software|||this gets you general info about constraints on each table - then
anything with a crdate newer than your baseline date are new. Hope this
helps.
J
select sc.*, so1.name as ownername, so2.*
from sysconstraints sc
inner join sysobjects so1 on sc.id = so1.id
inner join sysobjects so2 on sc.constid = so2.id
David Gugick wrote:
> Vai2000 wrote:
> You can use DDL Triggers in SQL Server 2005.
> --
> David Gugick
> Quest Software

No comments:

Post a Comment