sql - creating a trigger to update orderdata -


I have created a trigger in MS SQL Server 2005 is considered to trigger trigger orderdata. Example: Update

  Table ID Order 1 1 2 2 3 3 4 4  

so that there will be 2 orders for ID4.

  Table ID Order 1 1 2 2 3 3 4 2  

With my trigger, it will automatically create it afterwards.

  Table ID order 1 1 2 3 3 4 4 2  

My table looks distinctly different, but it does not matter too much, my The trigger should look like this.

  ALTER TRIGGER [dbo] [Testtrigger] running [dbo] After updating [pages], the declaration @ordernr numeric (18, 0) @parentid declares declaration as insert (18, 0) declaration @thisid numeric (18, 0) set @ordernr = (from the selection) Top 1 pageOrder) set @parentid = (top 1 pageParent from selection) set @thisid = (select from top 1 pageId to insert) if exists (select pageOrder from dbo.pages where PageParent = @parentid and pageOrder = @ordernr ) Start the update dbo.pages SET pageOrder = @ ordernr +1 where pageOrder = @ ordernr and PageId! = @thisid and PageParent = Many pages in the table have the same parent, so I need to place them in the right place, even if the page is at the top (aka  PagePaint ========== ================================================== ===============  does not work and it works if it is not zero. 

Then ... PageParent = @parentid is doing both true truths zero ? And if so, why would not this work

No, it is not something that is zero, It is not equal to anything else which is the tap. This is not equal to it, either.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -