How to make or set the table or database to store the data in UPPER CASE in Sql Server 2005?

  • Actually, I want to store the database data in the form of UPPER CASE.I don't want to use the front end function or UPPER function in sql server while storing.

    Thanks in advance.

  • Text data is just strings as far as SQL Server is concerned and UPPER is not any kind of data limit, but rather a format. You can probably use an INSTEAD OF trigger to force the data into upper case. It'll have to be on every table and check every text column.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Many Thanks, yes I think trigger is the only option to make the string into UPPER CASE.

    And, some tools are available to convert the entire database string into UPPER CASE however that are all like seperate process we have to take.

    Is there any other option Guys?

  • [font="Verdana"]

    Grant Fritchey (4/2/2008)


    Text data is just strings as far as SQL Server is concerned and UPPER is not any kind of data limit, but rather a format. You can probably use an INSTEAD OF trigger to force the data into upper case. It'll have to be on every table and check every text column.

    Why to use Trigger for such things and increase overhead on Server??? Why can't we use front end for such validations? Its always better approch to do it at front end.

    Thanks,

    Mahesh

    [/font]

    MH-09-AM-8694

  • elangovanp (4/2/2008)


    Many Thanks, yes I think trigger is the only option to make the string into UPPER CASE.

    And, some tools are available to convert the entire database string into UPPER CASE however that are all like seperate process we have to take.

    Is there any other option Guys?

    Do you mean, you wants to update the whole database to uppsecase?

    Can you let us know, is there any specific requirement, with proper example?

    Thanks,

    Mahesh

    MH-09-AM-8694

  • You could make this a constraint of the database to only allow upper case. Of course the best way to ensure this would be to update your stored procedures with the Upper function.

    what is the need for storing all the strings in uppercase?

  • The only place I've seen that upper cases everything is an Ibm Mainframe. I have some files that are copies of that data so I keep that data upper cased. I do agree that changing any data that comes into your system to upper case is a function of the programs, whether it is VB, Perl, stored proc, etc.

    If you need a one time conversion, you could write a script that would change existing data using the upper function but I would avoid upper casing everything if at all possible.

    Who is requiring this? Why do they want it? Unless compatibility with an archaic system is needed, there is no functional reason to upper case everything.

    Steve

  • Actually, one of our customer wants that his data should be stored in UPPER CASE only in database. and they are having some data in database already.

    Just I wanted to know whether there is any settings while installation so that we can make the database server to store data in UPPER CASE with out using the UPPER FUNCTION.

    Thanks......

  • We support a database with case insensitive collation. The app doesn't enforce case but will fail a case sensitive comparison. The comparison (PARTNO = pArtNo) fails in the executable of the app. We have no control over the app. Is there a way to force case on certain columns without using a trigger? It would be less problematic to change a column constraint than it would be to add triggers to the database.

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply