Board index » delphi » SQL Server Case Sensitive Issue

SQL Server Case Sensitive Issue

Hi all,

We have written an application for SQL Server using Delphi 4. All the SQL in
the queries etc that we use are in Uppercase. This is fine for case
insensitive SQL servers, everything works smoothly.

But as you can guess, its not so good for case sensitive SQL Servers. Our
tablenames and fieldnames are all in uppercase, but the system tables are
lower case, this causes problems obviously.

What is our best option that we can take now. Do we have to go through all
our statements and change them? If so is there a parameter somewhere that
you can read which tells us whether SQL Server is set up with case
sensitivity or not?

Has any of you guys had the same problem? What did you do to get around it?

Thanks in advance!

Jason

 

Re:SQL Server Case Sensitive Issue


Quote
"zanshin" <ja...@allsorts.net> wrote in message news:3bc6e18d_1@dnews...
> But as you can guess, its not so good for case sensitive SQL Servers. Our
> tablenames and fieldnames are all in uppercase, but the system tables are
> lower case, this causes problems obviously.

> What is our best option that we can take now. Do we have to go through all

Oh, boy... the answer is: Yes. You do have to go through (all) your code and
change queries addressing system tables to lower case. IMHO, this would only
be half of solution. Your (bigger) problem is that you work with system
tables directly. Unless absolutely necessary, you shouldn't be doing this.
The main reason: they may (and do) change. They change in purpose,
structure, new ones get added and old ones get dropped - with every new
release of SQL Server. MS warns about this is big block letters (unusual,
yet true). Instead, they provided a series of stored procedures that access
system tables providing users with myriad of info they need. In cases where
that's not sufficient, you should od the same: write a stored procedure -
easier maintenance if nothing else.

Quote
> our statements and change them? If so is there a parameter somewhere that
> you can read which tells us whether SQL Server is set up with case
> sensitivity or not?

There's no parameter per say. Well, there is, but it's not as simple as
that. You have to run sp_configure and read "default sortorder id" and
"Unicode comparison style" values (hope I'm not missing anything). You'd
want to compare those values then to a list sortorders and unicode
comparison styles, which can be installed in this particular version of the
server, to find out if the server is case sensitive or not. (Come to think
of it, maybe Unicode has nothing to do with it, but hey....).
Where's the list? Not a clue. Maybe on msdn site or you can ask on their
newsgroups.

On the other hand, you can bet that MS will always write their system tables
in lower case. Unfortunately, there are some system objects that are all
upper case. Go figure.

Bonne chance.

rb

Re:SQL Server Case Sensitive Issue


Quote
"rb" <ra...@killspam-videotron.ca> wrote in message news:3bc738b2_1@dnews...

<snip>

Cheers for that, on second look, it shouldnt be too bad, as we dont
reference the system tables too often. Although I think I will change it
around to use stored procedures as you have mentioned.

Thanks for the help!

Other Threads