May 27, 2009 at 5:41 am
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
May 27, 2009 at 7:23 am
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
May 27, 2009 at 9:48 am
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'
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply