How to create a trigger for insert only?
Answer / Payal Agrawal
"To create an INSERT-only trigger in MS SQL Server, you can use the `CREATE TRIGGER` command. Here is an example:nn```sqlnCREATE TRIGGER tr_InsertOnly ON [table_name]nAFTER INSERTnASnBEGINnIF EXISTS(SELECT * FROM inserted)nBEGINn-- Your code to perform operations based on the inserted datanENDnEND;n```
| Is This Answer Correct ? | 0 Yes | 0 No |
What are partitioned views?
what's new in sql server 2016?
What are difference between Cluster index and Non-Cluster index?
How to provide default values to stored procedure parameters?
What is a table called, if it has neither cluster nor non-cluster index? What is it used for?
How to set database to be single_user in ms sql server?
What is normalization and denormalization in sql server?
What is a system database and what is a user database?
How can you append an identity column to a temporary table?
What is data source object?
what's the difference between delete table and truncate table commands? : Sql server database administration
employee table has employee id ----------- empid ---------------- 1 2 3 3 3 4 5 5 5 6 6 6 7 here the values r repeated two times.how to select the repeated values only.i.e 3,5,6 should alone come.
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)