Welcome to Sign in | Help
in Search

Adaugare de PK in tabla mare

Last post 02-08-2010, 6:58 PM by rsocol. 2 replies.
Sort Posts: Previous Next
  •  02-08-2010, 12:14 PM 8039

    Adaugare de PK in tabla mare

    Salut,

    am o tabela cu 10000054 inregistrari, obtinuta prin bulk insert. Vreau sa pun un PK de tip int, isidentity. Daca incerc sa modific strunctura tabelei din SSMS, imi crapa cu eroarea:
    "
    Unable to modify table. 
    Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
    "

    dupa ce ma avertizeaza in prealabil:
    "Changes to tables with large amounts of data could take a considerable amount of time. While changes are being saved, table data will not be accessible."

    Cum sa procedez? vreau PK...

    Multumes,
    Lucian
  •  02-08-2010, 1:12 PM 8040 in reply to 8039

    Re: Adaugare de PK in tabla mare

    ALTER TABLE (pentru sintaxa vezi BOL)
  •  02-08-2010, 6:58 PM 8043 in reply to 8039

    Re: Adaugare de PK in tabla mare

    Două variante:
    1. Rulează script-ul de modificare într-o fereastră separată, la care nu se aplică timeout-ul (în mod implicit, timeout-ul de la Options / Query Execution / Execution time-out este 0, adică unlimited). Pentru asta, apeşi butonul "Generate Change Script" (din stânga sus), copiezi script-ul într-un "New Query" şi îl execuţi acolo.
    2. Modifici timeout-ul de la Options / Designers / Table and Database Designers la o valoare mai mare (maxim 65535 secunde, adica vreo 18 ore).

    Răzvan
View as RSS news feed in XML
Powered by Community Server (Commercial Edition), by Telligent Systems