473,224 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,224 software developers and data experts.

case sensitive database and sql command parameters

Hi guys,
I'm having problem with case sensitive collation of SQL Database. one
my client is having case sensitive database. While developing the Data
Layer i didn't consider this scenario.
the problem is I've all Store Procedures in the Database and I'm using
sqlcommand to execute those SPs with Parameters.
for e.g.
Data Layer:
......
SqlCommand cmd = new SqlCommand();
cmd.Parameters.Add("@param1", SqlDbType.VarChar);
........

Case Sensitive Database:

PROCEDURE [dbo].[SPxyz]
.....
@Param1 [nvarchar](4000),
......

you can notice that the parameter in the C# Code is in small cape
"param1" while it is declare with capital latter in Database "Param1".

this is causing the failure while executing the procedure through the
code.

Is it possible to ignore the case sensitivity while executing the SP
through code?

I would appreciate your response over my Query. if there is a ways to
ignore the case, then it will save lot of time to me otherwise i've to
go through several SPs to check for the parameter casing.

thanks,
Lucky
Jun 27 '08 #1
2 7217

I learnt this the hard way in 1999.

...

My advice is to always create your dev db with case sensitivity.
(Of course you know that, and are looking for a work around that works NOW).

I don't know of a work around.

The first time I had to do it, it scarred me enough for life....that I start
out my dev db's with case sensitivity now.
Especially when I deploy to an unknown client setup.
It took about 3-4 says to fix every tsql stored procedure and view.....you
can't imagine the permutations of somthing as simple as
@EmployeeID
@EmployeeId
@employeeID
@employeeId
and a few mistypes like
@eMployeeID

Good luck.

There are of course ways to force a collation on a db create.....if you give
the client tsql scripts.
I've found that drama is harder than using a dev/case sensitive db.

"Lucky" <tu************@gmail.comwrote in message
news:f9**********************************@w1g2000p rd.googlegroups.com...
Hi guys,
I'm having problem with case sensitive collation of SQL Database. one
my client is having case sensitive database. While developing the Data
Layer i didn't consider this scenario.
the problem is I've all Store Procedures in the Database and I'm using
sqlcommand to execute those SPs with Parameters.
for e.g.
Data Layer:
.....
SqlCommand cmd = new SqlCommand();
cmd.Parameters.Add("@param1", SqlDbType.VarChar);
.......

Case Sensitive Database:

PROCEDURE [dbo].[SPxyz]
....
@Param1 [nvarchar](4000),
.....

you can notice that the parameter in the C# Code is in small cape
"param1" while it is declare with capital latter in Database "Param1".

this is causing the failure while executing the procedure through the
code.

Is it possible to ignore the case sensitivity while executing the SP
through code?

I would appreciate your response over my Query. if there is a ways to
ignore the case, then it will save lot of time to me otherwise i've to
go through several SPs to check for the parameter casing.

thanks,
Lucky

Jun 27 '08 #2
I was reading that it was tough to alter the database, and I agree
with sloan that it wouldn't be too fun to do that. If you're
dynamically adding your parameters then I would consider adding a
method that will capitalize the first letter of the string.
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

32
by: Elliot Temple | last post by:
Hi I have two questions. Could someone explain to me why Python is case sensitive? I find that annoying. Also, why aren't there multiline comments? Would adding them cause a problem of some...
5
by: Madjid Nasiri | last post by:
Hi, I am basic in oracle. My Old programs write with Delphi and Databases: Access, Paradox, MySQL, Microsoft SQL. I write my code (SQL code) case-insensitivae, but now i need use oracle database....
1
by: Steve Thorpe | last post by:
Hi, How Can I create a case sensitive unique index so that A1 and a1 are treated as different ? I dont mind if I have to make a global DB change. Steve
4
by: aki999 | last post by:
We need to install CI database on CS server, and there are some issues with stored procedures. Database works and have CI collation (Polish_CI_AS). Server has coresponding CS collation...
1
by: Joe | last post by:
Hi, I have a login script and right now it is not case sensitive. I want to make it case sensitive. The userid and password is stored in MS Access DB and not in web.config. Can someone give me...
4
by: xAvailx | last post by:
Hello: I didn't find any documentation that notes save point names are case sensitive, but I guess they are... Stored Proc to reproduce: /* START CODE SNIPPET */ If Exists (Select * From...
10
by: syntego | last post by:
I think I have discovered a bug in the handling of null values (vs NULL values) passed as parameters to a stored proc. I have always believed that the database handled NULL and null the same. ...
6
by: Derik | last post by:
Okay, I THINK this is a PHP question... I've been mucking with PHP for awhile now, but just recently I've been poking at some ajax stuff, and I ran into something confusing; my Queries were...
11
by: Rafe | last post by:
Hi, I'm working within an application (making a lot of wrappers), but the application is not case sensitive. For example, Typing obj.name, obj.Name, or even object.naMe is all fine (as far as...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.