sql.netsql-servertrigger.iodatabase-trigger

Sql server trigger : Invalid 'inserted' object name


I have a table that I want to test on it a trigger I try to SELECTED the line of the query to see what the table contains but an error appear and In all MY sql project inserted and deleted table doesn't work for me this is what I wrote

the is the error that appear (On the Image)

CREATE TRIGGER TR
    on Ligne 
    for insert 
    as 
    begin
        select * from inserted
    end

enter image description here

please is there any solution for this problem and thanks

I find that when i hover on inserted it show me this enter image description here


Solution

  • Have you made sure intellisense is enabled in SSMS ?

    Go to Tools >> Options >> Text Editor >> Transact-SQL >> IntelliSense

    enter image description here

    Then - if it is enabled - sometimes it helps to refresh the local cache:

    enter image description here