Updatable views in sql server Part 40

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024
  • In this video we will learn about updating a view that is based on one or more base tables.
    Text version of the video
    csharp-video-tu...
    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 RUclips channel. Hope you can help.
    / @aarvikitchen5572
    Slides
    csharp-video-tu...
    All SQL Server Text Articles
    csharp-video-tu...
    All SQL Server Slides
    csharp-video-tu...
    All Dot Net and SQL Server Tutorials in English
    www.youtube.co...
    All Dot Net and SQL Server Tutorials in Arabic
    / kudvenkatarabic

Комментарии • 83

  • @ProphecyMzwah
    @ProphecyMzwah 9 лет назад +51

    Your presence on earth is heavenly gift from God. Thank you so much.

  • @anshulrajvanshi4618
    @anshulrajvanshi4618 9 лет назад +9

    @Venkat...You can't even imagine how are you helping thousands of people from your light of knowledge. The clarity in your explanation is amazing. Thank you vey much for taking time for all these efforts. God bless you son.

  • @Csharp-video-tutorialsBlogspot
    @Csharp-video-tutorialsBlogspot  11 лет назад +4

    Hi Anurag, Thank you very much for taking time to give feedback. Feedback like this is a morale booster for making more videos. Thank you again for taking time. Very few people do this.

  • @FavBlaDe
    @FavBlaDe 10 лет назад +2

    Man, your tutorials simply the BEST. Anyone can master on SQL Server & .NET Framework with these tutorials. These are worth thousand of dollars in my opinion and thousand times better than crappy books and paid services. So grateful, thanks.

  • @javierenriquez9263
    @javierenriquez9263 9 лет назад +11

    Thank you so much Venkat, I learned more from your tutorials than from a University course. I have my first interview for a SQL position next week... thanks to you man !!!

  • @anuragvashishtha6660
    @anuragvashishtha6660 11 лет назад +1

    The example of updating the base table wrongly is very carefully incorporated in the tutorial. It warns me of the possible pitfall of blindly categorizing the views into "Update possible" and "Update NOT possible". You certainly have a great flair for not just technology but also for teaching. Thank you and All the best for all you do!

  • @justinli19901027
    @justinli19901027 8 лет назад

    this man is a god!!!!! anyone want to learn sql, this is definitly the place to come!!!

  • @Tarikffm79
    @Tarikffm79 10 лет назад +5

    The method as you describe and explain the issues is amazing. I have spent the last few days, learned so much through your videos. Thank you @kudvenkat from Germany. I'll take a look and spread all your videos. You are a Great Teacher and a Big Personality! Thanks a lot! kudvenkat

  • @shubhenduinfotech5992
    @shubhenduinfotech5992 2 года назад +1

    Thanku kudvenkat. you are like a god gift for students like us

  • @rkb8379
    @rkb8379 11 лет назад +1

    I agree with Anurag...so cool and simple...but to THE BEST. Cheers Venkat...I'm just loving your videos and teaching...completed all of C# and turned to SQL...and aiming to cover the .NET after these...
    Your teaching is very impressive and injecting a special interest in me !!

  • @sanafareed88
    @sanafareed88 9 лет назад +1

    Hi Venkat. I recently started watching your videos and you are amazing! You explain everything with so much clarity. I have an interview for a technical SQL position and I feel so much more prepared and confident after watching your videos. Thank you!!

  • @afsangujarati9427
    @afsangujarati9427 6 лет назад

    I wonder why your videos are not the most viewed videos on youtube. Salute Sir!

  • @rajatbhawsar2750
    @rajatbhawsar2750 6 лет назад +1

    Thank you so much for sharing your knowledge with us.This is very helpful.

  • @deepahere87
    @deepahere87 10 лет назад

    really great videos.. i have gone through most of ur videos on sqlserver.. its all well explained.. Thank you so much !!

  • @krismaly6300
    @krismaly6300 9 лет назад +2

    Revisiting
    Thanks a lot for educating us

  • @NancyMancarious
    @NancyMancarious 7 месяцев назад

    This is a very good tutorial, thank youu

  • @shahdanyal7542
    @shahdanyal7542 4 года назад

    Everything explained very nicely and also showed the pitfall.

  • @bexoai1234
    @bexoai1234 8 лет назад

    All your training help me so much !!! thanks you

  • @slobodantajisic2762
    @slobodantajisic2762 3 года назад +1

    There are many problems here. What if our Id columns are identity columns? What if our Salary column in the base table is NOT NULL column etc ...

  • @krzysztofs8535
    @krzysztofs8535 7 лет назад

    U are great teacher ! Thank U for your explanation

  • @devexpost8508
    @devexpost8508 7 лет назад +2

    *Regarding Questions on:* *DML & Inserting, Deleting, Updating through a VIEW.*
    A VIEW is essentially a "Virtual Table" (or a "Stored Query"). Once created a View can be treated just like a table. (A Stored Procedure can not be treated like a table.) A View doesn't store data, it defines a way to look at data which resides in underlying table(s). Row and column level security can be introduced as shown in the video, and Permissions and Security Predicates can also be added to the View to further restrict available functionality.
    IMPORTANT NOTES:
    --------------------------------
    1. A VIEW allows access to Columns in an Underlying Table or Tables. Only those columns from the underlying Table which are "SELECTED" in the VIEW can be seen or accessed by users of the VIEW.
    2. All Columns SELECTED in the VIEW can be SELECTED by users of the VIEW.
    3. ALL Columns SELECTED in the VIEW _may_ be UPDATEable if they are _otherwise_ user updateable. This can be deceptive and dangerous, however, in cases where the column has come from a JOINed table. This is dangerous because it allows the update of a primary key attribute as if it applied only to the foreign key record. It obfuscates the fact that this value is one-to-many and many be related to other records also.
    4. Where a VIEW SELECTS only from a single table, *UPDATEs, DELETEs, and INSERTs* can be done on the underlying Table Columns/Rows through the VIEW, assuming all constraints can be satisfied.
    5. Where a VIEW SELECTS from _multiple_ Tables by using a JOIN, *UPDATEs* can be done on the underlying (multiple) Tables' Columns through the VIEW assuming all constraints can be satisfied, but *DELETEs, and INSERTs* can NOT be done on the Underlying Tables' Rows through the VIEW. Attempting to DELETE or INSERT on a VIEW with JOINed Tables will fail and produce a message like: "Msg 4405,... View or function 'vwViewName' is not updatable because the modification affects multiple base tables."
    6. For a VIEW which has not SELECTed all columns in the Underlying Table, INSERTING a Record through the VIEW will create a record in the underlying Table which has NULLs in the non-SELECTED (inaccessible) columns. If the Underlying Table has constraints like "NOT NULL" on these columns, the INSERT will fail and produce a message like: "Msg 515,... Cannot insert the value NULL into column 'ColumnName', table 'DBName.dbo.tblTableName'; column does not allow nulls. INSERT fails." If the VIEW-based INSERT results in a NULL in a column defined as a DATE type, the INSERT will fail and produce a message like: "Msg 241,... Conversion failed when converting date and/or time from character string."
    Best Regards.

  • @labeh3750
    @labeh3750 6 лет назад

    Your videos have helped me greatly .. Thank you so much

  • @rajeshwarikrishna06
    @rajeshwarikrishna06 3 года назад +1

    this is very nice, sir!

  • @jyotimakonati965
    @jyotimakonati965 4 года назад

    Hello Sir,
    Your all videos would help us and I will watch your all videos.
    Thank you very much for your great teaching sir

    • @Csharp-video-tutorialsBlogspot
      @Csharp-video-tutorialsBlogspot  4 года назад +1

      Hello Jyotima - 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.

  • @tboontboont3056
    @tboontboont3056 7 лет назад

    You are the man, well done.

  • @Jgamz17
    @Jgamz17 8 лет назад

    thank you so much, greetings from Mexico

  • @vinodhkumar7141
    @vinodhkumar7141 8 лет назад +1

    hi venkat how are you today...I have question like this.. here views. got updated it is based on multiple table. but wrong values.in instead of trigger it is also 2 under laying table but why error...ie why not allowing

  • @romaniup
    @romaniup Год назад

    Great tutorial!

  • @malharjajoo7393
    @malharjajoo7393 8 лет назад

    You are doing a really good job.

  • @abdelmalek9004
    @abdelmalek9004 4 года назад

    thank you for this video, it is very cool and useful.

  • @MdAliB-uv6bi
    @MdAliB-uv6bi 5 лет назад +3

    Venkat Sir, Thank you very much for your videos. In this video of PART-40 Updatable views in SQL server at 5:05 in this video when we execute
    Insert into vWEmploteeesDataExceptSalary values (2, 'Mikey', 'Male',2) the values has inserted but what about the Salary field of Mikey, we have not supplied any value to that field, So it may get NULL or any other value?

    • @AyanDas-rx4ol
      @AyanDas-rx4ol 5 лет назад

      gd question

    • @vivekfrancisxavier7000
      @vivekfrancisxavier7000 2 года назад

      For the salary column either it should have a default value set or Allow nulls should be checked. Otherwise we will get an error while trying to update the view.

  • @ayselceferzade8587
    @ayselceferzade8587 2 года назад

    awesome! thanks a lot!

  • @shivprajapati9981
    @shivprajapati9981 5 лет назад +1

    Sir please make a video of partitioning of table of sql methods like
    1.create the partition function
    2.create partition schema
    3. Create partition table with schema
    Log files
    Please make this video

  • @mtham3816
    @mtham3816 Год назад

    GREAT STUFF

  • @bizzar31
    @bizzar31 11 лет назад

    you are the best sir ...

  • @hudawm7
    @hudawm7 9 лет назад +1

    Great video!

  • @dnyaneshawar1
    @dnyaneshawar1 8 лет назад +3

    when i insert the data from view i got this error."View or function 'vWEmployeesByDepartment' is not updatable because the modification affects multiple base tables".

    • @raunakkh2602
      @raunakkh2602 3 года назад +1

      u can update view if that is based on single base table for multiple base table updation instead of triggers are used

  • @Adnan_Khan24
    @Adnan_Khan24 8 лет назад +2

    You are excellent. I love your tutorial. God bless you. I have question here I have virtual tables dbo.ETTO. Actually I am creating view on view.
    CREATE VIEW vwPOheader
    WITH SCHEMABINDING
    AS
    SELECT PO, PODATE, VDRNBR, TERM1, TERM2 FROM dbo.ETTO
    ERROR MESG:
    cannot schema bind with view 'vwPOheader', dbo.ETTO is not schema bound (#4513)

  • @RahulYadav-lq7ro
    @RahulYadav-lq7ro 7 лет назад +1

    really helpful videos,nice

    • @Csharp-video-tutorialsBlogspot
      @Csharp-video-tutorialsBlogspot  7 лет назад +1

      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
      ruclips.net/user/kudvenkatplaylists?view=1&sort=dd
      If you need DVDs or to download all the videos for offline viewing please visit
      www.pragimtech.com/order.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.
      ruclips.net/video/y780MwhY70s/видео.html
      If you want to receive email alerts, when new videos are uploaded, please subscribe to my youtube channel.
      ruclips.net/user/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

  • @SeekingSmiles236
    @SeekingSmiles236 3 года назад

    In practical, is updating or delting data through views is done?Is it feasible?

  • @naodagere8210
    @naodagere8210 4 года назад

    Gorgeous!

  • @sanketborawake5069
    @sanketborawake5069 8 лет назад

    hi,KudVenkat if you say views are used for security purpose so that user cannot update or delete in actual table and you showed that after updating views the data in table it uses also gets updated then where is the security in this?

  • @arshnareshsufi
    @arshnareshsufi 7 лет назад

    Hi Sir,
    Can you please help me on the below query which is while I am trying to deleting the record getting below error.
    I 've joined two tables in below query now here I am trying to delete name from list but while i am trying to update getting this below error and this I am facing this issue while inserting and deleting a records from a view
    ERROR
    ------------
    Msg 4405, Level 16, State 1, Line 28
    View or function 'dbo.emp_dept' is not updatable because the modification affects multiple base tables.
    QUERY
    -----------
    SELECT A.ID,A.NAME,A.GENDER,B.DEP_NAME FROM et a inner join dt b on a.DPET_ID=b.deptid
    where b.dep_name='IT'

  • @hungcao1342
    @hungcao1342 2 года назад

    nice !

  • @krismaly6300
    @krismaly6300 9 лет назад +4

    Views are updatable.
    How to create ReadOnly view or Non-updatable views?

    • @awesomekj5812
      @awesomekj5812 8 лет назад +1

      +Kris Maly you can create UnionAll with some dummy table to make View readonly

    • @krismaly6300
      @krismaly6300 8 лет назад

      +Awesome KJ
      Your idea may be good
      Could you please give me example

    • @awesomekj5812
      @awesomekj5812 8 лет назад +2

      +Kris Maly You can try something like this :
      create view vw_tblname
      as
      select col1, col2 from tbl1
      Union all
      select null,null where 1 = 0
      I tried it and it does not let you delete , insert or update any data through view

  • @heymanju
    @heymanju 5 лет назад

    Hi Venkat, have a question can we term VIEW tables as Marts as both might solve the same purpose??

  • @stutitehri993
    @stutitehri993 10 лет назад

    wow nice explanation on view

  • @saisantoshkumar5034
    @saisantoshkumar5034 3 года назад

    HI Venkat sir,
    Topics are getting easy but i want to practice those things. How can I practice those things?
    I am a fresher graduate now

  • @nimishajain8860
    @nimishajain8860 8 лет назад +1

    Thank you Sir :)

    • @Csharp-video-tutorialsBlogspot
      @Csharp-video-tutorialsBlogspot  8 лет назад +1

      +Nimisha Jain You are very welcome Nimisha and thank you for the feedback. I am very glad you found the videos useful.
      I have organised all the video tutorials in to playlists, which could be useful to you
      ruclips.net/user/kudvenkatplaylists?view=1&sort=dd
      If you need physical DVDs or you want to download all the videos for offline viewing please order them using the link below
      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.
      ruclips.net/video/y780MwhY70s/видео.html
      If you want to receive email alerts, when new videos are uploaded, please subscribe to my youtube channel.
      ruclips.net/user/kudvenkat
      If you like these videos, please click the THUMBS UP button below the video.
      We like to see these free video tutorials helping others as well. Please share the link with your friends and family who you think would also benefit from them.
      Thanks
      Venkat

  • @ST2601-h8m
    @ST2601-h8m 5 месяцев назад

    I have to insert the data from the view different database to the table of another database by creating new column please guide me

  • @sravanisridhara3029
    @sravanisridhara3029 7 лет назад

    why can't we just use the stored procedures instead of views? I mean both of them do the similar job right?

  • @balukrishna3581
    @balukrishna3581 7 лет назад

    superb lecture

  • @joefromdc
    @joefromdc 4 года назад

    Question, what is the code to add an existing column to a view. not create a new column

  • @wishingW3L
    @wishingW3L 10 лет назад +2

    I wish I could find a tutorial like this for C#!

    • @BradLane5
      @BradLane5 10 лет назад +7

      Not sure if you have looked or not, but Venkat's channel has TONS of c# videos, all explained with equal clarity. I would strongly suggest subscribing.

  • @smithuladennis5172
    @smithuladennis5172 6 лет назад

    Is age is a barrier to work on sql?, my age is 37 and i am looking for a Job related to sql.

  • @kalyanrevuru1800
    @kalyanrevuru1800 3 года назад

    Sir what's the difference between inline table valued functions and views. It's seems like they both work the same ... creating virtual tables

    • @raunakkh2602
      @raunakkh2602 3 года назад

      Inline allows parameter where as view wont allow

  • @lordgaulo6520
    @lordgaulo6520 3 года назад

    i need to create a script that auto likes your videos as soon as they load, if you teach us how we will run it

  • @maryamtlepbergenova3656
    @maryamtlepbergenova3656 4 года назад

    so what is non-updatable view then?

  • @saikumar-ub8wi
    @saikumar-ub8wi 7 лет назад

    way of teaching is nice .
    I have one question view was created by using 3 table,if i change anything in base tables it will reflect in View if do select all from view ?

  • @sushmitanigam4979
    @sushmitanigam4979 6 лет назад

    best

  • @akanshasoni3390
    @akanshasoni3390 8 лет назад

    Hello sir could you please publish materialized view video. It's highly needed.

  • @deepakbhardwaj5432
    @deepakbhardwaj5432 5 лет назад

    Sir please make videos on SSRS or ReactJS

  • @sandeepguptadevadula8500
    @sandeepguptadevadula8500 8 лет назад

    Would insert work with not null columns too?

    • @SuperGojeto
      @SuperGojeto 8 лет назад

      +sandeep gupta devadula i have the same question. But in such cases to avoid errors i would set a default value for such columns in the base table. So when someone tries to insert using views those non null columns will get default values and avoid errrors.

    • @SuperGojeto
      @SuperGojeto 8 лет назад +1

      +sandeep gupta devadula stackoverflow.com/questions/2648445/if-i-update-a-view-will-my-original-tables-get-updated check this out for answer to ur question.

    • @sandy294u
      @sandy294u 8 лет назад

      Salman Shaikh thanks for the clarification

    • @SuperGojeto
      @SuperGojeto 8 лет назад

      sandy294u glad to be of help! :)

  • @raunakkh2602
    @raunakkh2602 3 года назад

    I know its not relevant but HOW MUCH DO YOU EARN FROM YOUR Videos?
    Also, please share your social media details i wanted to follow it.
    Thanks...