Комментарии:
Wow your explanations are so easy to understand.... thank you so much for all your videos they are amazingly helpful.
Ответитьselect @id=id from Inserted
the id shouldn't be 9 instead of 1 when Jimmy was inserted , the employeeaudit got modified and should should store id as 9 and details as string specified why it took 1
Can someone please explain ?
hi , can anyone please help , i have created trigger successfully but now when i am trying to insert value in tblemploees, an error is coming - Invalid object name 'tblEmployeeAudit'.
ОтветитьI'm getting this error:
Column name or number of supplied values does not match table definition. In insert and delete
hi Venkat , may i know what is the use of declare statement in trigger
ОтветитьIf u encounter with error, please create identity for column id while creating employeeaudit table.
ОтветитьFor tblemployeeaudit
Column:audit data
Which data is used
What is the data type of Auditdata column in the tblEmployeeAudit table ?
ОтветитьAppreciate the Breakdown! Very easy to understand
Ответитьhow can i resolve the error saying column name Or number of supplied values does not match the table defination
ОтветитьYour videos are really helpful. Thanks Venkat.
ОтветитьHello brother thank u very much for the valuable tutorial and can u please tell me that did u created any tblemployeeaudit table separately because I have created the trigger and trying to add the values into the tblemployee table in thought of the values will automatically insert into tblemployeeaudit table but the error is coming like the object with name tblemployeeaudit is not found
ОтветитьHi Venkat Sir, this is a very nice explanation however this is one where when I try, I run into an error. Hope you could help.
After creating an audits table with id int primary key and audits varchar(200) columns, when I run the trigger:
Alter Trigger tr_userforinsert
on users
For Insert
as
Begin
Declare @Id int
Select @Id = Id from inserted
Insert into UserAudits
values('A new Employee with Id' +cast(@Id as nvarchar(20))+ 'has been added at'+cast(Getdate() as nvarchar(20)))
End
I get the following message:
Msg 213, Level 16, State 1, Procedure tr_userforinsert, Line 9 [Batch Start Line 11]
Column name or number of supplied values does not match table definition.
Is it necessary to kept id column as a primary key???
ОтветитьHi venkat. Is it possible to fire dml trigger when the data is committed.? If so, then how? Thank you hope to hear your answer.
ОтветитьYou are awesome teaching , Thank you so much for excellet video sir
ОтветитьCould u tell me which version of this sql server u r using? I am continuously getting an error of column names aren't matching with the magical table attributes inside a trigger.
Thank you!
Getting this error message while creating insert trigger please let me know how to fix it
''Column name or number of supplied values does not match table definition.
'
Very well explained!!!
ОтветитьI have to create a trigger that throws an error "You are not authorized" when we try to insert any row in a particular table. Can you pls help me create one?
Ответитьthe worst thing in this video is he didn't tell how to create tblemployeeaudit table.....normal students can't understand
ОтветитьWhy can't we use a Procedure or a Function to do what the Trigger does ?
ОтветитьVenkat your videos are too good, Thankyou for your help, Please keep up the good work
ОтветитьWhat happens if multiple values are to be inserted at a time ?
ОтветитьNow if we insert many and delete many will the inserted and deleted magic table maintain those record ?
-- anyone reply
Can you please provide the complete Query for the above example
ОтветитьWow!...
Ответитьi am getting this following error
Msg 213, Level 16, State 1, Procedure tbl_emp_for_insert, Line 9 [Batch Start Line 216]
Column name or number of supplied values does not match table definition.
what do i do someone plz reply
Thank you for this! Very helpful in my introduction to triggers. I've been using SQL server for a few years but never used this functionality before. Very clearly explained!
Ответитьyour voice is very natural and lovely keep it up....:)
ОтветитьI am getting error after insert values in tblemplyeeaudit ....& then try to execute the command
ОтветитьShould we not create the "tblEmployeeAudit" table before using it in creating the trigger?
ОтветитьSir I have error need help
What is the datatype of AuditData ?
I got error while converting bro
can you please help with the inserting multiple rows using triggers?
ОтветитьBrilliant sir......
ОтветитьIt was posted in 2012 and is still being benefitted from in 2020.
ОтветитьHello Sir, It is possible that a DELETE statement can remove multiple rows at a time (where as an INSERT statement can insert only 1 row at a time). In case of a DELETE statement affecting multiple rows (more than 1 row), How would the FOR trigger for DELETE statement work ? Will it insert the same number of records into audit table (as) the number of affected rows ?
ОтветитьSir your teaching method is very amazing, it helps us alot in mastering sql server, can you please make a detail video on "SECURING SQL SERVER".
Like logins, server roles, database roles, granting and revoking permissions, etc.
Will be waiting for your kind response.
Thanks in Advance
Regards:
Syed Noumanullah from Pakistan
please upload videos on collections in plsql along with BLOB and CLOB
ОтветитьNIce explaination. Thank you
ОтветитьHi,
this video is for the beginners who want to learn DML TRIGGERS or there is a separate video for that ?
Hi Sir, For Deleting Multiple records in one shot what i have to do?
Ответитьinset data in tblemployee table. I getting an error (String or binary data would be truncated.
The statement has been terminated.) can u explain what is the region for that?
Are you teaching DML from the beginning ?
ОтветитьThank you so much Sir for all your video's. The way you explains everything is awesome!!
Ответитьi love your videos, it helps me understand things so much better.. thanks , is there anyway i practice more ?
ОтветитьVery easy to understand still best in 2020
ОтветитьSELECT * from Employees;
SELECT * from Employees_Audit;
CREATE TRIGGER tr_Employees_ForInsert
ON Employees
FOR INSERT
AS
BEGIN
Declare @Id int
Select @Id = Id from inserted
insert into Employees_Audit
values ('New employee with Id = ' + Cast (@Id as NVARCHAR(5) ) + 'is added at' + cast ( Getdate () as NVARCHAR (20)))
END;
I got an error: Column name or number of supplied values does not match table definition. Could please reply. Thanks
Explanations are good but ur energy is low which somehow make bored
Ответить