try this for sql server
CREATE TRIGGER yourNewTrigger ON yourSourcetable
FOR INSERT
AS
INSERT INTO yourDestinationTable
(col1, col2 , col3, user_id, user_name)
SELECT
'a' , default , null, user_id, user_name
FROM inserted
go
More Related Contents:
- Create Trigger to log SQL that affected table?
- Solution for: Store update, insert, or delete statement affected an unexpected number of rows (0) [closed]
- Need to list all triggers in SQL Server database with table name and table’s schema
- How can I do a BEFORE UPDATED trigger with sql server?
- SQL Server Update Trigger, Get Only modified fields
- How do I prevent a database trigger from recursing?
- SQL update trigger only when column is modified
- Simulating group_concat MySQL function in Microsoft SQL Server 2005?
- How can I do an UPDATE statement with JOIN in SQL Server?
- Why does NULL = NULL evaluate to false in SQL server
- The multi-part identifier could not be bound
- How to insert a line break in a SQL Server VARCHAR/NVARCHAR string
- SQL – How to store and navigate hierarchies?
- SQL Query to get aggregated result in comma separators along with group by column in SQL Server
- Fastest way to update 120 Million records
- how can I Update top 100 records in sql server
- Count Number of Consecutive Occurrence of values in Table
- Is there a SELECT … INTO OUTFILE equivalent in SQL Server Management Studio?
- How can I compare time in SQL Server?
- SQL – Difference between COALESCE and ISNULL? [duplicate]
- SQL: capitalize first letter only [duplicate]
- Getting the Id of a row I updated in Sql Server
- Backup a single table with its data from a database in sql server 2008
- The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions
- COALESCE Function in TSQL
- What is the meaning of SELECT … FOR XML PATH(‘ ‘),1,1)?
- Try_Convert for SQL Server 2008 R2
- SQL Server variable scope in a stored procedure
- SQL Sort Order with Null values last
- When to use EXCEPT as opposed to NOT EXISTS in Transact SQL?