Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. SQL Server
  3. Question
SQL Server

How Instead of trigger Sql server used with Inserted table?

Asked by Benjamin Moore Apr 24, 2021 1.6K views 1 answer
Share

About this question

I have this trigger:

create TRIGGER Emp_log on Emp Instead of insert as SELECT * FROM INSERTED
Then i make this insert:
insert into emp values(99,'bbb','aaa','99','1900-09-09',99,99)

As a result no line was inserted in the emp table, as it should be. But anyway i got the display of the inserted row with the command SELECT * FROM INSERTED.

The question is: The "INSERTED" table contains what is written in the insert statement, or contains rows actually inserted? Because I expected no insert, and then no display from SELECT * FROM INSERTED. What is instead of trigger  SQL Server?

 

Your answer

1 Answer

More SQL Server discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest SQL Server Blogs

Guides, tips and career advice on SQL Server from JanBask experts.