Subject | Why Some People Should Get Smacked In The Head (or: MS SQL and Collations...) |
---|---|
Author | Martijn Tonies |
Post date | 2005-01-11T10:21:02Z |
Hello,
Just a small story about a recent annoyance...
As you probably know, Database Workbench supports
MS SQL Server as well... Or so we thought. It turns out
it supports some of SQL Server, but not all...
Someone evaluating Database Workbench for use with
MS SQL reported some strange behaviour.
When fetching metadata, he got this error:
The column prefix 'i' does not match with a table name or
alias name used in the query.
Now, "i" was used like this:
select ... i.index_name...
from sysindexes I
Guess what. The "I" alias was not the same as the "i" alias.
But only in this (and probably others) collation!
Quick testing revealed:
create table TABLEI
( col1 int )
select *
from tablei -> fails
select *
from TABLEI -> works
select *
from tableI -> works
Sjeez. And who am I to think that collations should only
affect data and not metadata.
The programmer who did this should get smacked in the
head :-)
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server
Upscene Productions
http://www.upscene.com
Just a small story about a recent annoyance...
As you probably know, Database Workbench supports
MS SQL Server as well... Or so we thought. It turns out
it supports some of SQL Server, but not all...
Someone evaluating Database Workbench for use with
MS SQL reported some strange behaviour.
When fetching metadata, he got this error:
The column prefix 'i' does not match with a table name or
alias name used in the query.
Now, "i" was used like this:
select ... i.index_name...
from sysindexes I
Guess what. The "I" alias was not the same as the "i" alias.
But only in this (and probably others) collation!
Quick testing revealed:
create table TABLEI
( col1 int )
select *
from tablei -> fails
select *
from TABLEI -> works
select *
from tableI -> works
Sjeez. And who am I to think that collations should only
affect data and not metadata.
The programmer who did this should get smacked in the
head :-)
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server
Upscene Productions
http://www.upscene.com