Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 16th, 2005, 02:49 PM
Registered User
 
Join Date: Mar 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Default sort changes after restore on new machine

Hi,

I migrated a database using backup/restore. On the new machine, a select * from one of the tables will not be in order of the index (a clustered index based on the column1, asc., it's an int 4, identity column). The sort order is the same on both machines.

The results returned by this table from a select * are different from the table on the other machine. On the new machine, the ordering does not begin at 1 for some reason, although it is sequential, there are 119 records at the beginning before it starts with 1. On the older machine, it starts with 1. Despite the fact that they shouldn't be using a select *, I guess some developers have used datasets that depend on the data being in this order. Using select top 10 returns the records in the correct order, I guess SQL Server inserts an order by clause somewhere for this.

Any ideas on how to get the new table to follow the order of the original table?





 
Old March 16th, 2005, 03:06 PM
Registered User
 
Join Date: Mar 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

So DBCC DBREINDEX (mytable, '', 70) fixes the problem...

Is there a way to do this automatically on restore?


 
Old March 16th, 2005, 05:02 PM
Registered User
 
Join Date: Mar 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Doesn't seem to be an option on restore, but I scripted it to occur just after using:

EXEC sp_MSforeachtable






Similar Threads
Thread Thread Starter Forum Replies Last Post
Retore Db from a remote machine to a local machine srkvellanki BOOK: Beginning SQL 0 October 3rd, 2008 05:17 PM
Dynamic sort order or sort datatype kapy_kal XSLT 2 September 18th, 2007 02:10 PM
how to sort cross tab.sort based on row total joxa83 Crystal Reports 7 March 2nd, 2006 09:12 AM
Unable to sort using xsl sort command sly_jimmy_boy XSLT 3 June 17th, 2005 05:15 AM
how to save & restore default printer settings? Tiffany Pro VB 6 1 April 7th, 2004 06:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.