Wednesday, 10 August 2016

enterprise geodatabase - Trigger on SQL Server 2008 ArcSDE 10 and ArcGIS Server 10


I need to build a sql server db trigger to update a date field with the current date when a record is inserted or updated, I think. I will be using the date field as a way to recognize updates/inserts programmatically. I went to sql server mngt studio and navigated to the database in the tree view >> opened up the programmability folder >> opened up the Trigger folder and right clicked >> Create new trigger >> I then copied the below sql into the window and hit F5. It messaged back to me that the command was successful but when I tried to open the Triggers folder I didn't see it there. When I tested in arcmap inserting a record I did not get the date updated to my date field.


What am I doing wrong and are there special considerations for creating Insert/Update/Delete triggers against SDE? Thanks...the sql is below.


>CREATE TRIGGER t_I_TestTable
>ON dbo.TestTable
>FOR INSERT
>AS

>
>UPDATE TestTable SET TestTable.LastUpdated = Getdate()


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...