|
Posted by Erland Sommarskog on 02/04/07 11:10
HC (hboothe@gte.net) writes:
> Erland, I copied all the DB files from the MSDE 2000 installation to
> the SQL Express 2005 system. The EXE (my program) is exactly the same
> on both systems, the databases are identical (I did a fresh copy over
> this morning in preparation for more testing so I'm quite certain they
> are the same). The files I copied are the MDF and the LDF files and I
> referenced them both in the sp_attach_db statement (sp_attach_db
> 'dbname', 'c:\dbdatafile.mdf', 'c:\dblogfile.ldf').
Great. I just want to make sure that you had not lost the SQL 2000
databases, so that you still have those to compare with.
> I'm sorry to be ignorant but I do not recognize the parameters you
> mention about the update stats, I will check BOL for this. I ran this
> on each db (use <db>, go, SP_UPDATESTATS, go).
You run UPDATE STATISTICS tbl WITH FULLSCAN for each table. sp_updatestats
runs UPDATE STATISTICS for table, but without FULLSCAN, which means that
it only samples data. For the small sets of data you mention, FULLSCAN or
not may be be a big deal.
Another way is to reindex all tables. When you reindex a table, statistics
are updated as with fullscan, as SQL Server has to read all rows anyway.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|