Solved

Column Name case-sensitivity issue

Posted on 2003-10-30
7
2,415 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
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Performance is the key factor for any successful data integration project, knowing the type of transformation that you’re using is the first step on optimizing the SSIS flow performance, by utilizing the correct transformation or the design alternat…
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

744 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now