DDL Tiggers

  • Hi All,

    I am working on client-server application....client been mobile application (with sql ce) and on the server side I have SQL Server 2005.

    I am performing synchronization of the data ..and to track schema change i tried out DDL triggers and it worked out....:)

    Is there any way by means of which i can track shcema change on server?

    But now my main issue is I want to notify the client whenever the schema changes on the server and get the changes reflected on the client db.Can you guys please suggest me as to how can i procced with it?

    Thanks in advance

  • If I am not mistaken, In SQL 2005 there is a default trace that audits all DDL statements. I think you might be able to use it.

    -Roy

  • The Default Trace tracks that Objects were altered, but not what the change was. Try this query:

    SELECT

    TE.[name],

    I.*

    FROM

    sys.traces T CROSS Apply

    :: fn_trace_gettable(CASE WHEN CHARINDEX('_', T.[path]) 0

    THEN SUBSTRING(T.PATH, 1, CHARINDEX('_', T.[path]) - 1) + '.trc'

    ELSE T.[path]

    End, T.max_files) I JOIN

    sys.trace_events AS TE ON

    I.EventClass = TE.trace_event_id

    WHERE

    T.id = 1 AND

    TE.[name] = 'Object:Altered'

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply