This question already has an answer here:
I get error "Procedure tr_employee_tbl_forinsert Column name or number of supplied values does not match table definition" when I run the
INSERT query below. What should I do?
create table employee_tbl ( EmpID int primary key, FirstName varchar(50), LastName varchar(50), Salary float, MobileNo varchar(15) ) create table employeeaudit_tbl ( EmpID int primary key, AuditData varchar(50) ) GO create trigger tr_employee_tbl_forinsert on employee_tbl for insert as begin declare @EmpID int select @EmpID = EmpID from inserted insert into employeeaudit_tbl values('New employee with EmpID = ' + CAST(@EmpID as nvarchar(5)) +'is added at ' + CAST(GETDATE() as nvarchar(50))) end GO