Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a database which had all it's foreign-key relationships dropped at some unknown time in the past (don't ask). I have an old copy of the database which isn't good to restore from, but the schema has the relationships. I'm working from that to create a script to restore the keys.

In updating the tables, I've had to drop statistics from several tables. Do I need to manually recreate those, or can I just run the statistics update procedure when all the tables are updated?

share|improve this question
Belongs on stackoverflow ? – gbn May 14 '10 at 16:26
up vote 1 down vote accepted

Statistics will be created by the engine when needed, or by an explicit CREATE STATISTICS

Personally, I'd do nothing with the statistics.

Saying that, I'm very surprised you had to drop statistics for any reason. Do you mean indexes? I've never had to drop or create statistics manually, ever.

share|improve this answer
I have to drop (and recreate) indexes too, but it specifically complained about statistics. Perhaps you've never run into it because you've never had to recreate all the FKs on an already running db. ;) – Adam J.R. Erickson May 14 '10 at 17:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.