Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2007.07.08;
Скачать: CL | DM;

Вниз

Что в триггере не правильно?   Найти похожие ветки 

 
fd979 ©   (2007-04-10 12:40) [0]

Такой квери:
CREATE TRIGGER [DeductQuanFromLoc] ON [dbo].[INVMOV]
FOR Insert
AS
begin
  Update INVMTRLOC Set
    INVMTRLOC.LocQuantity = INVMTRLOC. LocQuantity + [Inserted].[Movetype] * [Inserted].[Quantity]
 Where (INVMTRLOC.MaterialCode = Inserted.MaterialCode) and (INVMTRLOC.Location = Inserted.LocationFromTo)
end


выдает:
Server: Msg 107, Level 16, State 2, Procedure DeductQuanFromLoc, Line 5
The column prefix "Inserted" does not match with a table name or alias name used in the query.

В чем проблема? Может кто-то помочь?


 
stone ©   (2007-04-10 12:45) [1]

Inserted  это тоже таблица, но у тебя это нигде не указано


 
Polevi ©   (2007-04-10 12:55) [2]

CREATE TRIGGER [DeductQuanFromLoc] ON [dbo].[INVMOV]
FOR Insert
AS
begin
 Update INVMTRLOC Set
   INVMTRLOC.LocQuantity = INVMTRLOC. LocQuantity + [Inserted].[Movetype] * [Inserted].[Quantity]
 FROM INVMTRLOC, Inserted
Where (INVMTRLOC.MaterialCode = Inserted.MaterialCode) and (INVMTRLOC.Location = Inserted.LocationFromTo)
end


 
fd979 ©   (2007-04-10 13:36) [3]

Огромное спасибо обоим.

ПС. Посыпаю голову пеплом



Страницы: 1 вся ветка

Текущий архив: 2007.07.08;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.018 c
15-1181121766
ERDe
2007-06-06 13:22
2007.07.08
1c:предприятие


2-1181016283
mrFreeman
2007-06-05 08:04
2007.07.08
Перевод из TStrings в String и чтение строки из TListBox


2-1181821417
SunriseGirl
2007-06-14 15:43
2007.07.08
ShowMessage


15-1181392665
Ломброзо
2007-06-09 16:37
2007.07.08
Помирает тачпад


3-1175946319
boristt
2007-04-07 15:45
2007.07.08
Перехват ошибки от MSSQL Express 2005 (dbExpress)