UPPERCASE DATA

  • Is there a way to make sure that all the data in the SQL Database automatically be put in uppercase? 

  • You can do this for each table... don't know about the whole DB tho...

     

     

    CREATE

    TRIGGER dbo.Tr_MyTable_F_IU ON dbo.MyTable

    AFTER

    INSERT, UPDATE

    AS

    SET

    NOCOUNT ON

    UPDATE

    MT SET MyCol = UPPER(MyCol) from dbo.MyTable MT inner join Inserted I on MT.KeyCol = I.KeyCol

    GO

  • Implementing instead of triggers would work.  That way you can format the data how you want it.

  • Not sure why you'd want that except to make searching easier for programmers.  If that is your desire you can install SQL Server for it to NOT be case sensitive. 

    Thank-you,
    David Russell
    Any Cloud, Any Database, Oracle since 1982

  • Other alternative - not as clean - would to be run a job that uppercases any rows changed since the last run. The triggers mentioned earlier are pretty lightweight, no reason not to use them.

Viewing 5 posts - 1 through 4 (of 4 total)

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