SQL Trigger Not working on Azure

  • Hi all,

    First of all I am a novice. I have googled and spent a lot of time on this problem but can't get a solution that works for me.

    I have a two simple trigger that works fine on a local sql dbase. see below

    TRIGGER 1

    CREATE TRIGGER [dbo].[trplayermediaCreateDate] ON [dbo].[PlayerMedia]

    AFTER INSERT

    AS

    UPDATE playermedia

    SET playermedia.DateAdded=getdate()

    FROM playermedia

    INNER JOIN Inserted ON playermedia.PlayerMediaID= Inserted.PlayerMediaID

    However when i transfer the same trigger to Azure and add a record, I get

    "The Target Table 'dbo.PlayerMedia' of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT without INTO clause"

    Any help much appreciated.

  • Hi there,

    Sorry, this isn't going to be a direct answer to your question. I'm not an Azure guru, and I try to avoid triggers where I can, but I thought I'd drop you a message as you've had no other responses yet, so ignore me if you want.

    Are you limited to using this trigger in Azure? Are you trying to re-create an existing on-premise database for instance. If not, it would seem that setting a column default might be more appropriate?

    Good luck.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply