Posted on: 4/10/2012 11:57:04 AM | Views : 431

Hi All
Im basically using a SDK that tries to update a whole table row even when I am trying to update only one specific field.  The problem is that one of the fields is an identity column so the update cannot go through.

I have been trying to create a trigger that will fire when an update of the counter (i.e identity column) is sent, take the information from the created "inserted" table and carry out the update.

I have listed below what I have so far that does not work
USE [***] GO /****** Object: Trigger [dbo].[OnUpdateOfCounter] Script Date: 04/10/2012 16:47:24 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER TRIGGER [dbo].[OnUpdateOfCounter] ON [dbo].[Customer] FOR UPDATE AS SET NOCOUNT ON IF ( UPDATE(Counter)) BEGIN UPDATE [Customer] SET [Customer].[CustomerName] = inserted.[CustomerName] FROM inserted WHERE [Customer].[CustomerCode] = inserted.[C ...

Go to the complete details ...