AXForum  
Go Back   AXForum > Microsoft Dynamics AX > DAX: Программирование
All
Forgotten Your Password?
Register Forum Rules FAQ Members List Today's Posts Search Mark Forums Read

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 01.10.2010, 11:35   #1  
Stainless is offline
Stainless
Участник
MCBMSS
Columbus IT
 
34 / 114 (4) +++++
Join Date: 26.01.2007
! Триггер SQL вызывает ошибку при обновлении записи
Здравствуйте,

При заведении 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
Проверялось на AX2009SP1 (5.0.1500.2116)

Last edited by Stainless; 01.10.2010 at 11:37.
Tags
sql, update, триггер

 

Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection к другому SQL Server Poleax DAX: Программирование 5 19.10.2010 10:49
Проблема.База данных SQL обнаружила ошибку. kalex_a DAX: Программирование 14 20.04.2010 19:11
БД SQL обнаружила ошибку. Нет полей в таблице Alexx7 DAX: Администрирование 11 11.11.2009 15:12
Создание новой записи + Фильтр (3.0 SP5 KR2 SQL) polygris DAX: Программирование 7 03.01.2008 16:17
Dynamics AX: SQL Server, Heart of Dynamics AX Blog bot DAX Blogs 0 13.07.2007 18:00
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Рейтинг@Mail.ru
All times are GMT +3. The time now is 23:56.
Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Contacts E-mail, Advertising.