Instead of insert trigger Part 45

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ส.ค. 2024
  • In this video we will learn using instead of insert trigger to insert a row into a view that is based on multiple tables.
    Text version of the video
    csharp-video-tutorials.blogspo...
    Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our TH-cam channel. Hope you can help.
    / @aarvikitchen5572
    Slides
    csharp-video-tutorials.blogspo...
    All SQL Server Text Articles
    csharp-video-tutorials.blogspo...
    All SQL Server Slides
    csharp-video-tutorials.blogspo...
    All Dot Net and SQL Server Tutorials in English
    th-cam.com/users/kudvenka...
    All Dot Net and SQL Server Tutorials in Arabic
    / kudvenkatarabic

ความคิดเห็น • 66

  • @sohanyennu3750
    @sohanyennu3750 7 ปีที่แล้ว +12

    I really enjoyed this video...very informative

    • @Csharp-video-tutorialsBlogspot
      @Csharp-video-tutorialsBlogspot  7 ปีที่แล้ว +5

      Hello Dear Sohan,
      Thank you very much for taking time to give feedback. This means a lot. I am very glad you found the videos useful.
      I have organised all the Dot Net & SQL Server videos in to playlists, which could be useful to you
      th-cam.com/users/kudvenkatplaylists?view=1&sort=dd
      If you need DVDs or to download all the videos for offline viewing please visit
      www.pragimtech.com/kudvenkat_dvd.aspx
      Slides and Text Version of the videos can be found on my blog
      csharp-video-tutorials.blogspot.com
      Tips to effectively use my youtube channel.
      th-cam.com/video/y780MwhY70s/w-d-xo.html
      If you want to receive email alerts, when new videos are uploaded, please subscribe to my youtube channel.
      th-cam.com/users/kudvenkat
      If you like these videos, please click on the THUMBS UP button below the video.
      May I ask you for a favor. I want these tutorials to be helpful for as many people as possible. Please share the link with your friends and family who you think would also benefit from them.
      Good Luck
      Venkat

  • @Csharp-video-tutorialsBlogspot
    @Csharp-video-tutorialsBlogspot  11 ปีที่แล้ว +6

    Thank you very much for taking time to give feedback. In the description of this video, I have included the link for ASP .NET, C#, and SQL Server playlists. All the videos are arranged in logical sequence in these playlists, which could be useful to you. Please share the link with your friends who you think would also benefit from them. If you like these videos, please click on the THUMBS UP button below the video. For email alerts, when new videos are uploaded, you may subscribe to my channel.

  • @lazykitten4356
    @lazykitten4356 5 ปีที่แล้ว +5

    you are the BEST sql teacher on TH-cam> Thank you so much!

  • @elainemayer8978
    @elainemayer8978 11 ปีที่แล้ว +3

    I've watched over 30 of your sql training videos. They're all very helpful. Thank you so much for taking time to make these videos.

  • @krzysztofs8535
    @krzysztofs8535 7 ปีที่แล้ว +2

    very useful videos. i'm going to end the whole course. till now they quality is on the high level

  • @pramodkumarsura1880
    @pramodkumarsura1880 10 ปีที่แล้ว +2

    Hello Venkat,
    You are awesome, your teaching is very soft and nice. a layman can understand the concept easily.

  • @renganathansrb5032
    @renganathansrb5032 6 ปีที่แล้ว +1

    You are awesome, your teaching is very soft and nice.
    Thanks for ur videos.

  • @cassavates
    @cassavates 11 ปีที่แล้ว +1

    Hi Venkat, let me thank you very much for this thorough and detailed and beginner-friendly training - it is not even on my mother-tongue and still I understand also the complex stuff I thought I might not understand :) Also it teaches how to be structured for SQL thinking, and for my DB-s consistency and unambiguity. Great training, thanks and congratulations, and I wish a lot of success with your work for the future! Sincerely: cassavates

  • @kaviyarasan3624
    @kaviyarasan3624 4 ปีที่แล้ว

    I has started confused on Feb 5 in joining two tables using trigger but I'm not find any resolution for the requirement. But now I find because you was teaching me. Thank you so much.

  • @sumitbhardwaj2992
    @sumitbhardwaj2992 6 ปีที่แล้ว

    i like your all video, and thank those friend whose tolled me, watch prazym technology videos your video is too long but u difine many things in detail if any body have no knowledge about programing language your video is very helpful of those people india proud of your Mr. kudvenkat u i am very happy of your work and u give free teach in good quality every one not gud in english so u should one copy of hindi language

  • @shivaganga9148
    @shivaganga9148 2 ปีที่แล้ว +1

    Once we see any video of yours we don't want to repeat it again that simple we can learn

  • @Felixantony84
    @Felixantony84 10 ปีที่แล้ว

    Very useful. Thank you master...

  • @sweetysharma2621
    @sweetysharma2621 2 ปีที่แล้ว

    Intresting one 💕

  • @hariishr
    @hariishr 4 ปีที่แล้ว +1

    Initially difficult to understand this topic (as I'm from non IT background)
    After watching few times n slowly following steps in the blog understood this , thank you

    • @Csharp-video-tutorialsBlogspot
      @Csharp-video-tutorialsBlogspot  4 ปีที่แล้ว +1

      Hello Harish - Thank you very much for the feedback. Means a lot. I have included all the sql tutorial videos, slides and text articles in sequence on the following page. Hope you will find it handy.
      www.pragimtech.com/courses/sql-server-tutorial-for-beginners/
      When you have some time, can you please leave your rating and valuable feedback on the REVIEWS tab. It really helps us. Thank you. Good luck and all the very best with everything you are doing.

  • @nimeshambalalpatel3032
    @nimeshambalalpatel3032 3 ปีที่แล้ว

    Great teaching sir!!!

  • @harishme4726
    @harishme4726 4 ปีที่แล้ว

    Nice explanation sir hatsoff.. keep on doing more..

  • @nishigandhaghadage6350
    @nishigandhaghadage6350 4 ปีที่แล้ว

    Very useful. Thank You very much!

  • @stutitehri993
    @stutitehri993 10 ปีที่แล้ว +2

    god bless you;sir

  • @sayalithakar4526
    @sayalithakar4526 7 ปีที่แล้ว

    Hi Venkat,very useful video.Please put videos on Datastructures and Algorithm

  • @gkmishra2009
    @gkmishra2009 3 ปีที่แล้ว

    great tutorial

  • @SuperGojeto
    @SuperGojeto 8 ปีที่แล้ว +1

    I have a small doubt. Initially when u created the trigger as select * from inserted.
    Then insert into view statement and execute the statement.
    But no data gets actually inserted in the view even though the trigger fires.
    So how is possible that the select * from inserted returns the row that we were trying to insert???

  • @redduck8068
    @redduck8068 9 ปีที่แล้ว +1

    Excelent videos

  • @henrifanda4784
    @henrifanda4784 5 ปีที่แล้ว

    very well explained. thx.

  • @richardlah6030
    @richardlah6030 10 ปีที่แล้ว +3

    HI Kudvenkat
    I am thro with the sql server which was excellent. My interested is heightened in the other 2 courses i.e C# and ASP.Net . Can you advise on the effective order to study these 2. Should it be C# first or Asp.net.
    Many Thanks
    Richard

  • @Mousesenpai
    @Mousesenpai 2 ปีที่แล้ว

    best in class

  • @piyasidey2117
    @piyasidey2117 4 ปีที่แล้ว

    Thank you very much Sir.

  • @ivvhis9841
    @ivvhis9841 3 ปีที่แล้ว

    THANK YOU !

  • @ChhajedShweta
    @ChhajedShweta 8 ปีที่แล้ว +1

    Hello sir, can you please suggest best way to insert multiple rows using instead of inert trigger.
    Example provided in the video works fine when query insert only 1 row at a time.
    But it failed when I tried inserting multiple rows. I also tried one by using cursor, which worked as expected but adversely hit query performance. Any suggestion will be of great help.

  • @cascadeaklilu3343
    @cascadeaklilu3343 8 ปีที่แล้ว

    thank you sir

  • @kabeerbindra3061
    @kabeerbindra3061 5 ปีที่แล้ว

    Thanks 🥰

  • @MukeshKumar-vy6ep
    @MukeshKumar-vy6ep 4 ปีที่แล้ว +1

    very useful videos.....Thank you and sir can you upload some of the python videos for begineers

    • @sapnanayak1453
      @sapnanayak1453 ปีที่แล้ว

      Yes! I want Venkat sir to do a Python series too.

  • @devexpost8508
    @devexpost8508 7 ปีที่แล้ว +1

    It's a fine example for a tutorial, but note that the trigger assumes the DeptName column is unique, and also that there is only a single row insert being performed.

    • @creedyrn24
      @creedyrn24 8 หลายเดือนก่อน

      You just spoke my mind. How would it result if it’s a non-unique column and how could we insert multiple tables at once..These are my thoughts.
      Hopefully I find these answers in the future

  • @hussainmadar4
    @hussainmadar4 7 ปีที่แล้ว

    +kudvenkat when I create a trigger ,it inserts the columns in inserted but cannot insert it into base tables?

  • @MrCshrawankumar
    @MrCshrawankumar 9 ปีที่แล้ว +1

    Hi Venket,
    Thanks for ur videos.
    I have a small doubt regarding raise error thing. When u tried to insert invalid department name in the view there was an error saying "Invalid Department name. Statement terminated". When nothing is executed after this error, then y we get "1 row(s) affected" msg below the error msg?

    • @prabhatKumar-dh6fr
      @prabhatKumar-dh6fr 5 ปีที่แล้ว +1

      I think because one row got inserted into special inserted table of triggers.

  • @techdurgesh3532
    @techdurgesh3532 6 ปีที่แล้ว

    Sir, I have a problem. I want to get the record from TABLE _1 and update the table _2 and the original tbale (TABLE _1) I have no updates and updated record table _2 I get inserted.

  • @bextla3737
    @bextla3737 7 ปีที่แล้ว

    Hi. it is useful. when l insert new values to view table, l face with problem that 'Conversion failed when converting the nvarchar value 'IT' to data type int'.
    How can l fix this?

  • @cascadeaklilu3343
    @cascadeaklilu3343 8 ปีที่แล้ว +1

    hi I got a lot from this and old other lesson. cld u advise me where to star in programing tnx

    • @Csharp-video-tutorialsBlogspot
      @Csharp-video-tutorialsBlogspot  8 ปีที่แล้ว +2

      +Cascade Aklilu Thank you very much for taking time to give feedback. This means a lot. I am very glad you found the videos useful.
      I have organised all the Dot Net & SQL Server videos in to playlists, which could be useful to you
      th-cam.com/users/kudvenkatplaylists?view=1&sort=dd
      The following is the order
      1. C#
      2. Dot Net Basics
      3. SQL Server
      4. ADO .NET
      5. ASP .NET
      6. GridView tutorial
      7. MVC
      8. WCF
      9. Entity Framework
      10. LINQ
      11. LINQ to XML
      12. LINQ to SQL
      13. Chart Control
      14. JavaScript
      15. JavaScript with ASP .NET
      16. jQuery
      17. AngularJS
      If you need DVDs for offline viewing please visit
      www.pragimtech.com/kudvenkat_dvd.aspx
      Slides and Text Version of the videos can be found on my blog
      csharp-video-tutorials.blogspot.com
      Tips to effectively use my youtube channel.
      th-cam.com/video/y780MwhY70s/w-d-xo.html
      If you want to receive email alerts, when new videos are uploaded, please subscribe to my youtube channel.
      th-cam.com/users/kudvenkat
      If you like these videos, please click on the THUMBS UP button below the video.
      May I ask you for a favor. I want these tutorials to be helpful for as many people as possible. Please share the link with your friends and family who you think would also benefit from them.
      Good Luck
      Venkat

  • @mohammadshawn2458
    @mohammadshawn2458 8 ปีที่แล้ว

    nice

  • @harshavardhan8018
    @harshavardhan8018 6 ปีที่แล้ว

    Hi Venkat,
    While we are trying to check the user supplied DepartId (@DeptId) with the DepartmentId in the table, what is the reason that we are using '=' operator instead of '==' operator. Please clarify.

    • @mocanada304
      @mocanada304 2 ปีที่แล้ว

      I am pretty sure there is no double equal sign in MS SQL or even MySQL.
      You always use single = to compare in MS SQL, as you do in the WHERE clause.

  • @HibaAlMasri
    @HibaAlMasri 3 ปีที่แล้ว

    Hi Kudvenkat, 1st thank you so much for the SQL tutorial. 2nd what if the user enters multiple rows in an insert statement and one of the rows have a wrong department? the variable for department would not be null but there will be a wrong department..

    • @colombuzz8550
      @colombuzz8550 2 ปีที่แล้ว

      Thats why there is a lookup into department table for junk data( dept name).!!
      And for multiple insertions we can handle by looping through each record!!

  • @Shankar-zi3yk
    @Shankar-zi3yk 7 หลายเดือนก่อน

    can we do the same using for insert

  • @dharmender1975
    @dharmender1975 6 ปีที่แล้ว

    please make on partition in sql

  • @muayas9602
    @muayas9602 8 ปีที่แล้ว

    Why having "id" column as identity gives me 0 in "select * from inserted".

  • @leenadeore1403
    @leenadeore1403 4 ปีที่แล้ว

    Hi Sir, Why didn't insert value in department table it doesn't exists already?

  • @Shivakumar-367
    @Shivakumar-367 11 หลายเดือนก่อน

    Is this admin and development cource ???

  • @mostafaabdelnasser8969
    @mostafaabdelnasser8969 10 ปีที่แล้ว

    you hitting the target soo good

  • @uhanunipurc
    @uhanunipurc ปีที่แล้ว

    I am getting a message when trying to insert a new row: "Msg 544, Level 16, State 1, Procedure tr_vWEemployeeDetails_InsteadOfInsert, Line 23 [Batch Start Line 3]
    Cannot insert explicit value for identity column in table 'tblEmployee4' when IDENTITY_INSERT is set to OFF."

  • @user-lq1wt9wz8q
    @user-lq1wt9wz8q 6 หลายเดือนก่อน

    We can use instead of trigger on table and if No than why ¿??

  • @tonyfdd
    @tonyfdd 5 ปีที่แล้ว

    Hi sir ,
    One small doubt
    In that trigger why do v need that last line I.e select Id,name,gender,@depid from inserted

    • @MrMohican1989
      @MrMohican1989 4 ปีที่แล้ว

      A bit late but you need it because you have retrieved the right ID number from the table where departments are described and stored that value in the @id variable. So now you need to insert the rights values into the first base table which you weren't able to do correctly because you had the 'DepartmentName' and not the department 'Id' when you tried to raw insert the statement as the first base table is ID | NAME | GENDER | DEPARTMENT ID. When you finally insert into the base table you haven't stored the others value anywhere so we need to retrieve them too and use them directly with SELECT ID, NAME, GENDER (till here equals the raw insert beside the Select instead Insert keyword) and @ID (which now holds the ID of the department which we only knew the name on the first try of the insert statement) FROM inserted. I think SQL engine know it will not have to find @ID from table inserted as it is a variable that we already assigned but it will retrieve all other values that are valid for our insert.

  • @shabbirali5899
    @shabbirali5899 6 ปีที่แล้ว

    I m learning SQL very well from yours tutorial :) I have a small doubt e.g
    you create a int variable and join depname between tables and put these into Int variable
    Why? plz explain

  • @ungeheurenungeziefer2662
    @ungeheurenungeziefer2662 3 ปีที่แล้ว

    Important note: it works only with INNER JOIN inside triggers body. I typed LEFT JOIN somewhy and nothing works :)

  • @nishademperor8695
    @nishademperor8695 5 ปีที่แล้ว

    sir you could have given an easy example instead of this complicated one