473,398 Members | 2,165 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,398 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 7252

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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.