TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
narasiman rao
NA
519
768.6k
when i am creating a trigger shows error
Mar 19 2017 2:39 AM
The above one is doing in sql server 2008
tblemployeedetailsas follows
id int
Name Varchar(50)
Salary Varchar(50)
Gender Varchar(50)
Deptid int
Tblaudit as follows
id int
Auditdata varchar(50)
i am creating a trigger whenever record inserted in the tblemployeedetails, in tblaudit record will be inserted. for that i am creating a trigger as follows.
create triggger tbl_insert_foremployee
on tblemployeedetails
for insert
AS
BEGIN
declare @id int
select @id = id from inserted
insert into Tblauditdata
values ('New employee with id = ' + cast(@id as varchar(5)) +
'is added at ' + cast(Getdate() as nvarchar(20)))
END
GO
when i execute the above trigger shows error as follows
Unknown object type 'triggger' used in a CREATE, DROP, or ALTER statement.
please help me what is the mistake i made.
Reply
Answers (
3
)
how to do convert rows into columns
wheres error in my code