Hi All,
Is there a way to SPEED up the process of alter table - Add constraint on a
table with PRE_EXISTING data? This is a LARGE table.
What I am trying to do here is REMOVE the old constraint and add a NEW
one...
Here is what I am figuring as a way to speed things up...
1) bcp out
2) drop constraints
3) truncate table
4) bcp in
5) add constraints
Found this link while searching past posts:
http://sqljunkies.com/WebLog/amacha...onstraints.aspx
Thanks...MALTER TABLE WITH NOCHECK
prevents the new restraint from checking existing data at add time.
"Michelle" <smiley2211@.yahoo.com> wrote in message
news:etvWhKyWFHA.3348@.TK2MSFTNGP14.phx.gbl...
> Hi All,
> Is there a way to SPEED up the process of alter table - Add constraint on
a
> table with PRE_EXISTING data? This is a LARGE table.
> What I am trying to do here is REMOVE the old constraint and add a NEW one
..
> Here is what I am figuring as a way to speed things up...
> 1) bcp out
> 2) drop constraints
> 3) truncate table
> 4) bcp in
> 5) add constraints
> Found this link while searching past posts:
> [url]http://sqljunkies.com/WebLog/amachanic/articles/ScriptTableConstraints.aspx[/url
]
>
> Thanks...M
>|||But note that it only applies for check and FK constraints.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Erik Moore" <erikmoore@.austin.rr.nospam.com> wrote in message
news:uUJn2lyWFHA.2060@.tk2msftngp13.phx.gbl...
> ALTER TABLE WITH NOCHECK
> prevents the new restraint from checking existing data at add time.
>
> "Michelle" <smiley2211@.yahoo.com> wrote in message news:etvWhKyWFHA.3348@.T
K2MSFTNGP14.phx.gbl...
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment