sql server - Effects of dropping PK on other indexes -


I need to update a large number of keys in a large SQL Server 2005 database and on a bunch of FKS and PKS Will be abandoned The table, the update (which changes the values ​​of P / FK) and then adding FK and P again

are asking me:

  1. Will this process have any impact on the indices on those tables, which are listed in PK / FK areas or indexed other unaffected areas? That is, all the indexes still exist, will they need to rebuild one?

  2. This process will affect table statistics, requires a recalc?

    Many thanks

    The server (which is usually the package index) will become all non-indexed indexed drop and rebuild (this is necessary because if you have the package index then non-packages indexed index index index) If you have a cluster index (a Heap), non-clustered indexed data row

    package update Ramanika will automatically update the data, pointing to reconstruction will not be a reorg,

    If you create things with cascade update , they should be updated automatically

    example

      create table primary (id int no zero primary key) Go create form foreignK (filename not int) ALTER table dbo.ForeignK add constraint FK_ForeignK_pri foreign key (FID) Refer to reference on dbo.pri (ID) to go to CASCADE DELETE Do not take pri values ​​(1) Enter foreignK values ​​(1)   

    Update PK table now

      update pri set id = 5 go   

    it will still be select from foreign

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -