Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 SQL Server 2008 Upgrade

Author  Topic 

Ravikumarc
Yak Posting Veteran

51 Posts

Posted - 2010-10-06 : 13:47:58
Dear All,

We are moving our databases from SQL server 2000 sp4 to SQL server 2008 R2,some of the queries that is running in sql server 2000 is throwing errors.

For example:

select * FROM Customer (nolock) where c_customer_source_Session_id=0

works in sql server 2000, column c_customer_source_Session_id is a varchar column where as in sql server 2008 column value for c_customer_source_Session_id has to be in single quotes to make the query work.

Example: select * FROM Customer
(nolock) where c_custmer_source_Session_id = '0' .

It would be very difficult to find update all scripts in the application, is there a setting(like global setting) that can be done in one place so that all scripts need not be updated

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-10-06 : 14:00:26
You could try running it in 80 compatibility level, however you will not get to use the new features in 90 or 100.

But really, when you upgrade, you need to do a full regression test to identify all of the problem areas and correct them.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Ravikumarc
Yak Posting Veteran

51 Posts

Posted - 2010-10-06 : 14:16:52
quote:
Originally posted by tkizer

You could try running it in 80 compatibility level, however you will not get to use the new features in 90 or 100.

But really, when you upgrade, you need to do a full regression test to identify all of the problem areas and correct them.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog



Hi Tara,

Yes i have tried in 80 compatibility level..but still im getting the error.Let me know is there any sql environment settings which we have to change..

Thanks & Regards
Ravi
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-10-06 : 14:20:17
There isn't any setting that addresses your issue then.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-10-07 : 02:37:00
If NOLOCK is your main problem then strip them all out of the code (rather than fixing them by adding "WITH" as is now required). They are incredibly dangerous (do you know why? if not please ask). Use READ_COMITTED_SNAPSHOT (which is a database setting) instead and all your READS will not block WRITEs (I am making a bold assumption that is why you are using NOLOCK).

Have you used the Upgrade Advisor? I don't know if that will find all your incompatible code, but whatever it finds you can fix before you start your regression test, which will reduce the number of regression cycles you have to do!

See also SQL2008 Migration: Hints and Tips SQL 2008
Go to Top of Page
   

- Advertisement -