Vinay's profileVinay Thakur - Sql Serve...PhotosBlogLists Tools Help

Blog


    October 30

    Consider this while doing any UPDATE

    Trigger:

    When you create trigger for insert and delete we will get two reference table as “inserted” and “deleted” respectively now what if we create a trigger for “update” on trigger, your answer might be  we will get reference table “updated” :-) …. NO their is no updated table in trigger.

    Here when we create a trigger for “update” on any table it will use two reference tables “deleted” and “inserted” to make the update.

    Replication:

    In the same way when we make any update on publisher it will go to subscriber as two statement Delete that records and insert that records.

    As I already explain it here and also discuss about the issue we get due to this here.

    We come across situation that when we have update on primary key. our replication may fail as update will be delete and insert to subscriber.

    DELETE statement conflicted with COLUMN REFERENCE constraint 'FK_xxxx'. The conflict occurred in database 'DBnamexxx', table 'tablexxxxx', column 'column_pk'.

    I explain the resolution what I do here.

    Update on table:

    When we update the data from any column and that data size fits into the page that will be ok. but when the data is not fit into the page they in that case update will delete that records from that page and insert into new page…

    http://blogs.msdn.com/sqlserverstorageengine/archive/2006/12/13/More-undocumented-fun_3A00_-DBCC-IND_2C00_-DBCC-PAGE_2C00_-and-off_2D00_row-columns.aspx.

    Also update on huge data will also impact the performance. will try to blog more detail about Update in future.

    Let me know your thought on this.

    Thanx.

    Vinay

    @thakurvinay

    http://www.eggheadcafe.com/software/aspnet/29906548/how-does-update-statement.aspx

     

     

     

    .

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://vinay-thakur.spaces.live.com/blog/cns!645E3FC14D5130F2!594.trak
    Weblogs that reference this entry
    • None