Solved

Column Name case-sensitivity issue

Posted on 2003-10-30
7
2,434 Views
Last Modified: 2009-01-10
It is a long story, but I need a way to execute an INSERT INTO command without SQL Server being case-sensitive to the column names.  Is there a way to do this?  The column names that I am using in the INSERT are of the wrong case and I am getting "Invalid Column Name" errors because of this.  

Thanks for any help.
0
Comment
Question by:jsprenk55
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 15

Assisted Solution

by:namasi_navaretnam
namasi_navaretnam earned 50 total points
ID: 9652904
This option needs to be specified when creating the database. You can create an instance of SQL server that is not case sensitive.
0
 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 9652915
SEE STEP 6 to see how this can be done.


How to create a case-sensitive instance of SQL Server 2000 (Setup)
To create a case-sensitive instance of SQL Server 2000

Run SQL Server Setup to install SQL Server 2000 Components, select Install Database Server, and then click Next at the Welcome screen of the SQL Server Installation Wizard.


In Computer Name dialog box, Local Computer is the default option and the local computer name appears in the edit box. Click Next.


In the Installation Selection dialog box, click click Create a new instance of SQL Server, or install Client Tools, and then click Next.


Follow the directions on the User Information and related screens.


In the Installation Definition dialog box, click Server and Client Tools, and then click Next.


In the Instance Name dialog box:
To create a case-sensitive default instance, accept the Default check box and click Next.


To create a case-sensitive named instance, clear the Default check box and type an instance name.
In the Setup Type dialog box, click Custom, and click Next.


In the Select Components, Services Accounts, and Authentication Mode dialog boxes, change or accept the default settings, and then click Next.


In the Collation Settings dialog box, you have two options:
To make a Windows Locale collation case-sensitive, select Collation designator and then select the correct collation designator from the list. Clear the Binary check box, and then select the Case-sensitive check box.


To make a SQL collation case-sensitive, select SQL Collations, and then select the correct collation name.
For more information about collation options, click Help. When you finish setting the options, click Next.

In subsequent dialog boxes, change or accept the default settings, and then click Next.


When you are finished specifying options, click Next in the Start Copying Files dialog box.


In the Choose Licensing Mode dialog box, make selections according to your license agreement, and click Continue to begin the installation.
0
 
LVL 2

Accepted Solution

by:
doryllis earned 50 total points
ID: 9653362
The upshot of what namasi_navaretnam has said is that either you recreate the database as case insensitive and move everything over or you fix your Insert statement to be correctly cased.

Good luck,
Dory
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Assisted Solution

by:AndrewNovick
AndrewNovick earned 50 total points
ID: 9653746
Hi

If you can change the name of the table in the insert statement, you could create an updatable view with the names in upper case.  But, if you can't change the table name, I think that you'll have to change either the column names in the insert or the case sensitivity of the server as previously stated.

Regards,
Andy

Novick Software
www.NovickSoftware.com
Home of the free T-SQL UDF Of the Week Newsletter
0
 
LVL 50

Expert Comment

by:Lowfatspread
ID: 9654095
Hi jsprenk55,

sorry why is this a problem?
what do you want to do?
show us the query and we can re-write it!
we can even generate it using the correct case probably?

an please maintain your open questions...
what is it you actually want..4 open questions:
10/30/03 http://www.experts-exchange.com/Q_20783394.html "Column Name case-sensitivity issue"
10/30/03 http://www.experts-exchange.com/Q_20783318.html "GetColumnNames() is returning all upperc..."
07/31/03 http://www.experts-exchange.com/Q_20696004.html "Is there a way to clear the undo buffer?"
02/11/03 http://www.experts-exchange.com/Q_20509655.html "Using dates in SELECT with Microsoft Acc..."
 

Cheers!
0
 
LVL 17

Assisted Solution

by:Tacobell777
Tacobell777 earned 50 total points
ID: 9654486
Isn't there a way to say to SQL server at run time not to be case sensitive? I thought there was, by setting the Collation?
0
 

Author Comment

by:jsprenk55
ID: 9697013
We ended up modifying selects to accommodate case issue.  Thanks for all your help.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
I have a large data set and a SSIS package. How can I load this file in multi threading?
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question