![]() |
#1 |
Участник
|
![]()
Здравствуйте,
При заведении update триггера на любой таблице, у которой заполняется поле ModifiedDateTime выдается ошибка: Quote:
[Microsoft][SQL Native Client][SQL Server]The target table 'Имя_таблицы' of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause.
X++: ALTER TRIGGER [dbo].[InventTableLog] ON [dbo].[InventTable] AFTER UPDATE AS BEGIN DECLARE @RecId AS bigint SELECT @RecId = max(RecId) FROM [dbo].[InventTableAudit] IF @RecId IS NULL BEGIN SELECT @RecId = 0 END INSERT INTO [dbo].[InventTableAudit] (ItemId, ItemCategoryId, LogModifiedDateTime, RecVersion, RecId) select ItemId, ItemCategoryId, getdate(), 1, @RecId+1 FROM INSERTED END Last edited by Stainless; 01.10.2010 at 11:37. |
|
Tags |
sql, update, триггер |
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread |
Display Modes | |
|