SQL Tutorial - How to change data in a View

Поділитися
Вставка

КОМЕНТАРІ • 9

  • @seyisonade1194
    @seyisonade1194 Рік тому +1

    Thanks a million sir,
    For all value adding contents and tutorials

  • @fanzfanzilla
    @fanzfanzilla Рік тому +1

    Thank you so much for the video. Its very helpful. I smashed the thumbs up for you. One thought regrading the last comparison is that it depends on the sourceKey. So if you have two data sets that does not have a sourceKey then using the last recommendation may not work since you have join on the sourceKey.

  • @KabirKhan-xi3ju
    @KabirKhan-xi3ju 5 місяців тому +1

    Hi BeardedDev, I do have a challenge that I am facing. Let say you are creating a view on top of multiple schemas dbo and dbo2, dbo2 has some auxiliary fields in new table, that in the future will become a single schema in dbo. How would you change data in that sort of view where insert is needed for both tables? Lets say I don't want to use triggers on the view and schema dbo cannot be changed. Will really be interested to know your answer.
    Thanks.

    • @BeardedDevData
      @BeardedDevData  5 місяців тому

      Think we should throw updating through a View out of the window for that scenario, this video was to show it can be done but it's very rare that it should be done. Creating the View on top of multiple tables is great but to run multiple inserts especially if the tables are related you need to use a stored procedure to control logic and add error handling.

  • @srinivasaodela9878
    @srinivasaodela9878 Рік тому +1

    i always thought Views were Read-Only.
    what would be the advantage of updating view against updating a table directly ?
    Could you answer ?

    • @BeardedDevData
      @BeardedDevData  Рік тому +1

      Sure, so there isnt any real advantage in updating a view over a table, it's really designed for occasions where you don't want to give users access to the underlying tables but want to allow updates or perhaps the view is used to join many tables to resolve keys, you may prefer updating the view rather writing out an update statement based on those joins.

  • @pabeader1941
    @pabeader1941 Рік тому +1

    Should rename it as 'with a View 'not 'in a view'.