Tuesday, February 14, 2012

Compatibility level bug?

I think found a bug in SQL Server 2005 with respect to the database
compatibility level.
Scenario:
2 DBs on the same SQL Server 2005:
- fbSunshore
- swSunshore
Both DBs with compatibility level set to SQL Server 2005
Both DBs have a table 'Steuerschluessel'
Test 1:
Run the following statements:
USE swSunshore
UPDATE Steuerschluessel SET Info = '?'
Result: NO problem!!
Test 2:
Run the following statements:
USE swSunshore
UPDATE Steuerschluessel SET Info = '?'
FROM Steuerschluessel AS ThisTable
INNER JOIN fbSunshore..Steuerschluessel
ON ThisTable.Steuerschluessel
= fbSunshore..Steuerschluessel.Steuerschluessel
Result: 'Invalid columns name: 'info':
Test 3:
Set the compatibility level of swSunshore to SQL Server 2000
an rerun the statements from Test2
USE swSunshore
UPDATE Steuerschluessel SET Info = '?'
FROM Steuerschluessel AS ThisTable
INNER JOIN fbSunshore..Steuerschluessel
ON ThisTable.Steuerschluessel
= fbSunshore..Steuerschluessel.Steuerschluessel
Result: NO problem
AFAIK info is not a reserved word in SQL Server 2005, so I can not find a
reason for this behavior.
Any idea?
Bernd Beekes
have you tried this
USE swSunshore
UPDATE ThisTable.Steuerschluessel SET ThisTable.Info = '?'
FROM Steuerschluessel AS ThisTable
INNER JOIN fbSunshore..Steuerschluessel
ON ThisTable.Steuerschluessel
= fbSunshore..Steuerschluessel.Steuerschluessel
"BerndB" <BerndB@.discussions.microsoft.com> wrote in message
news:B9B02693-E908-4CD2-B9C7-E115A5F268EE@.microsoft.com...
> I think found a bug in SQL Server 2005 with respect to the database
> compatibility level.
> Scenario:
> 2 DBs on the same SQL Server 2005:
> - fbSunshore
> - swSunshore
> Both DBs with compatibility level set to SQL Server 2005
> Both DBs have a table 'Steuerschluessel'
> Test 1:
> Run the following statements:
> USE swSunshore
> UPDATE Steuerschluessel SET Info = '?'
> Result: NO problem!!
> Test 2:
> Run the following statements:
> USE swSunshore
> UPDATE Steuerschluessel SET Info = '?'
> FROM Steuerschluessel AS ThisTable
> INNER JOIN fbSunshore..Steuerschluessel
> ON ThisTable.Steuerschluessel
> = fbSunshore..Steuerschluessel.Steuerschluessel
> Result: 'Invalid columns name: 'info':
> Test 3:
> Set the compatibility level of swSunshore to SQL Server 2000
> an rerun the statements from Test2
> USE swSunshore
> UPDATE Steuerschluessel SET Info = '?'
> FROM Steuerschluessel AS ThisTable
> INNER JOIN fbSunshore..Steuerschluessel
> ON ThisTable.Steuerschluessel
> = fbSunshore..Steuerschluessel.Steuerschluessel
> Result: NO problem
> AFAIK info is not a reserved word in SQL Server 2005, so I can not find a
> reason for this behavior.
> Any idea?
> --
> Bernd Beekes
|||Thank You! it works!
Ihad to introduce the 'ThisTable' alias after upgrading to SQL Server 2005
(i. e. in SQL 2000 everything was OK w/o that alias). So there is at least
some logic in this ...
Bernd Beekes
"tolgay" wrote:
...

No comments:

Post a Comment