tag:blogger.com,1999:blog-6082652835152798567.post4468206784213820367..comments2024-03-28T00:58:12.736-07:00Comments on Sql server, .net and c# video tutorial: Instead of insert trigger - Part 45Unknownnoreply@blogger.comBlogger10125tag:blogger.com,1999:blog-6082652835152798567.post-88488478760684920242023-09-14T03:09:18.704-07:002023-09-14T03:09:18.704-07:00why am i getting an error called invalid column wh...why am i getting an error called invalid column when doing the join with inserted tableAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-38974793342279481832022-05-05T03:59:09.030-07:002022-05-05T03:59:09.030-07:00I am getting a error when i am using the inserted ...I am getting a error when i am using the inserted table. What is the solutionAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-88009256963528097232020-07-18T17:15:25.752-07:002020-07-18T17:15:25.752-07:00Video and text very helpful. Easy to followVideo and text very helpful. Easy to followAnonymoushttps://www.blogger.com/profile/07112520764023410539noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-16503913572862410302015-03-26T12:43:43.798-07:002015-03-26T12:43:43.798-07:00Thanks for posting video and written text. I prefe...Thanks for posting video and written text. I prefer reading text. However, videos are equally helpful.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-15138318196254257502014-04-26T10:42:21.209-07:002014-04-26T10:42:21.209-07:00thank you so much. that helps a lot.
for the guy w...thank you so much. that helps a lot.<br />for the guy who provides us with the query in the comment above, I see it's the same thing. <br /><br />thank you all and god bless youAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-19955716417364441402013-05-18T15:06:51.242-07:002013-05-18T15:06:51.242-07:00Thanks Venkat this is the best example I could com...Thanks Venkat this is the best example I could come across with instead of trigger, God bless you.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-1946003474735996252013-02-21T05:36:23.042-08:002013-02-21T05:36:23.042-08:00@Abhishek Yadav
I Think You Should Use This Quer...@Abhishek Yadav <br /><br />I Think You Should Use This Query<br /><br />Create Table TBLEmployee<br />(<br />Id Int Primary Key Identity Not Null,<br />Name Varchar(30) Not Null,<br />Gender varchar(20) Not Null,<br />DepartMentId int Foreign Key References TBLDepartment(DeptId) Not Null<br />)<br /><br /><br /><br />Create Table TBLDepartment<br />(<br />DeptId Int Primary Key Identity Not Null,<br />DeptName Varchar(30) <br />)<br /><br /><br /><br />Insert Into TBLDepartment Values('IT');<br />Insert Into TBLDepartment Values('Payroll');<br />Insert Into TBLDepartment Values('HR');<br />Insert Into TBLDepartment Values('Admin');<br /><br />Insert Into TBLEmployee Values('John','Male',3);<br />Insert Into TBLEmployee Values('Mike','Male',2);<br />Insert Into TBLEmployee Values('Pam','FeMale',1);<br />Insert Into TBLEmployee Values('Todd','Male',4);<br />Insert Into TBLEmployee Values('Sara','FeMale',1);<br />Insert Into TBLEmployee Values('Ben','Male',3);<br /><br /><br /><br /><br />Create View VW_Employee_Department<br />As<br />Select Id,Name,Gender,DeptName From TBLEmployee <br />Join<br />TBLDepartment<br />On<br />TBLDepartment.DeptId=TBLEmployee.DepartmentId<br /><br /><br /><br /><br /><br />Create Trigger Tr_VW_Employee_Department_Insert<br />On VW_Employee_Department<br />Instead Of Insert<br />As<br />Begin<br />Declare @DeptId Int<br />Select @DeptId=DeptId From TBLDepartment<br />Join Inserted On Inserted.DeptName=TBLDepartment.DeptName<br />If(@DeptId Is Null)<br />Begin<br />RaisError('Invalid Department, Statement Terminated',16,1);<br />End<br /><br />Insert Into TBLEmployee(Name,Gender,DepartmentId) Select Name,Gender,@DeptId From Inserted<br />End<br /><br /><br />Insert Into VW_Employee_Department Values(8,'Sunil','Male','HR');<br /><br />Select* From tblEmployee<br /><br />Select* From tblDepartment<br />Select* From VW_Employee_Department<br /><br />--Drop Table tblEmployee<br />--Drop Table tblDepartment;<br />--Drop View VW_Employee_Department<br />--Drop Trigger Tr_VW_Employee_Department_InsertAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-43471335602282770052013-02-17T10:03:29.926-08:002013-02-17T10:03:29.926-08:00Sir, Can we Perform Instead of Insert Trigger on T...Sir, Can we Perform Instead of Insert Trigger on Table Having Identity property???<br />Bcoz When I performed this operation on a table with IDENTITY, I've got Error regarding Identity property...<br />Please Help Me out......Anonymoushttps://www.blogger.com/profile/14132442293989193948noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-39841592634853871052013-01-24T12:05:31.771-08:002013-01-24T12:05:31.771-08:00So, how does this trigger work for a thousand rows...So, how does this trigger work for a thousand rows at a time, i.e.<br /><br />INSERT INTO tblEmployee(Id, Name, Gender, DepartmentId)<br />SELECT Id, Name, Gender, DepartmentID<br />FROM tblBulkLoadFromMerger<br /><br />when some departmentid's are new and some are not (arbitrary order)?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-48037950515949696782012-09-25T10:01:21.383-07:002012-09-25T10:01:21.383-07:00Thanks Venkat...
I enjoy with your videos...
Yo...Thanks Venkat...<br /><br />I enjoy with your videos...<br /><br /><br />Your video's are awesomeAnonymoushttps://www.blogger.com/profile/08897067125000085644noreply@blogger.com