Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL script problem between SQL 7 and SQL 2000

Status
Not open for further replies.

NickN

MIS
Jun 27, 2001
17
0
0
US
I have been in the process of migrating SQL 7 (WIN NT server)to another server with WIN2000 and SQL 2000. I did a back up and restore and am now in testing phase. For some reason, eventhough the scripts are identical I am getting different (incorrect) results from SQL 2000. I am not sure what I am missing. All other scripts run fine on the new server except for this one which involves a using a cursor imbedded in another cursor. Any advice on what I need to check on. Does SQL 2000 handle cursors in a diffent way?

Thanks.
 
Could it be a default sort order difference between the two SQL Server databases? I have noticed that when the SQL 7 database returns the data it sorts with the most recent records last. The new SQL server 2000 database results are in random order. Did I miss something on installation of SQL server 2000?
 
By definition in sql if you need the records in a certain order you need to sort them. 7 returning most recent first was more of a coincidence than garanteed. If the procedure needs the records in a particular order retrieve them that way. If you need them last entered first, you need to either have a datetime filed keeping track of the entry time or a incremented key you can sort in decending order.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top