|
Posted by Neil on 01/03/08 03:07
"Erland Sommarskog" <esquel@sommarskog.se> wrote in message
news:Xns9A176B0C5EC8CYazorman@127.0.0.1...
> Neil (nospam@nospam.net) writes:
>> I think that's a good idea. What about the idea of just exporting it to a
>> blank db, like I did today, with the triggers, indexes, and constraints
>> in
>> place, and then reimporting it with those? Then only the referencing
>> constraints would have to be recreated.
>
> Whichever way you fancy, as long as you don't wreck anything.
>
> But if you do it that way, you don't even have to drop the referencing
> constraints, you only need to disable them:
>
> ALTER TABLE tbl NOCHECK CONSTRAINT fk_this_that
>
> to enable them, this is the command:
>
> ALTER TABLE tbl WITH CHECK CHECK CONSTRAINT fk_this_that
>
> A somewhat bizarre syntax, but without the WITH CHECK part, SQL Server
> will just enable the constraints without checking them.
>
> And whichever path you go, use SQL Compare as I suggested to verify that
> you have all in place!
>
Well, all's well that ends well. I transferred the data to a new table,
etc., etc., and did a shrink on the database. Database went down to 1.2 GB.
Been running for a couple of days, and everything seems fine.
So, thanks so much for your help! Strange that this happened in the first
place; but at least it was able to be dealt with. And thanks for the
exchange. Was beneficial on many levels.
Thanks again, and have a great new year!
Neil
Navigation:
[Reply to this message]
|