Search

Thursday, July 28, 2011

View changes in DDL

Often we need to look for changes in a customers database. A clue to this can be found in the system table sysobjects. Everytime an object is changed, it is logged here. I use this code to list the changes:

SELECT name, crdate,schema_ver,type
FROM sysobjects
ORDER BY crdate DESC

The reslut tells me the name of the changed object, time and what type it is. The types are:

C = CHECK constraint
D = Default or DEFAULT constraint
F = FOREIGN KEY constraint
L = Log
FN = Scalar function
IF = Inlined table-function
P = Stored procedure
PK = PRIMARY KEY constraint (type is K)
RF = Replication filter stored procedure
S = System table
TF = Table function
TR = Trigger
U = User table
UQ = UNIQUE constraint (type is K)
V = View
X = Extended stored procedure

No comments:

Post a Comment