You are here: Re: BEGINNER: simple Delete trigger « MsSQL Server « IT news, forums, messages
Re: BEGINNER: simple Delete trigger

Posted by R.A.M. on 07/06/06 08:46

On Thu, 6 Jul 2006 08:25:27 +0000 (UTC), Erland Sommarskog
<esquel@sommarskog.se> wrote:

>I understand the errors, but I understand about as little of your
>trigger that SQL Server does. You seem to be making things up out of
>thin air. When you say:
>
> IF Documenty.Movement = 'PZ' OR Documents.Movement = 'ZW'
I meant Documents.Movement
>
>What are Documenty and Documents supposed to be? Maybe you mean
>
> IF EXISTS (SELECT *
> FROM deleted
> WHERE movement IN ('PZ', 'ZW'))
Exactly
>
>
>The same goes for
>
> DELETE FROM PositionsPZZW
> WHERE Documents.Number IN (SELECT Number FROM deleted);
>
>This would compile if you have a column Documents in PositionsPZZW,
>and this columns is of a CLR UDT and had an attribute named Number.
>What this really should be, I don't even want to guess, since I know
>nothing about PositiosnPZZW.
I need:
IF EXISTS (SELECT * FROM deleted WHERE Movement IN ('PZ', 'ZW'))
DELETE FROM PositionsPZZW
WHERE Number IN (SELECT Number FROM deleted);

>By the way, why are there three Positions tables? Maybe there is a good
>reason for this, but I have a suspicion that one should do.
They have different columns describing items.

Thank you, you have helped me... Problem closed
Could you help me with post "one more question"? Thank you!
/RAM/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация