Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 convert all firebird data to uppercase

Author  Topic 

Helloise Smit
Starting Member

22 Posts

Posted - 2008-09-04 : 07:19:15
i have to convert all firebird data to uppercase without specifing the column names, there are to many columns and i have to do it for 156 tables...tableNames[l].

"SELECT UPPERCASE(*) FROM " + "" + tableNames[l] + ""; ????
what would the select statement look like?
thank you
helloise

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-04 : 07:22:23
You dont really require to do this conversion in db itself. You can keep the data as it is and do this conversion only while retrieving data either in sql or in your front end application (where there are formating functions available).This is purely a formatting issue and should be worried only when displaying data at your presentation layer.
Go to Top of Page

Helloise Smit
Starting Member

22 Posts

Posted - 2008-09-04 : 07:33:00
i have to re-write the data to sql server and firebird is case sensitive ans sql server not. in fire bird i have column data ex: fmCashbox,FmCASHBOX etc. it is a PK. in sql server i get a PK contraint violation. i want to convert to uppercase and skip writing duplicate rows...
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-04 : 07:36:13
quote:
Originally posted by Helloise Smit

i have to re-write the data to sql server and firebird is case sensitive ans sql server not. in fire bird i have column data ex: fmCashbox,FmCASHBOX etc. it is a PK. in sql server i get a PK contraint violation. i want to convert to uppercase and skip writing duplicate rows...


but again even if you bring them in sql server, you'll have problems in retrieving data (when you want to retrieve records of FmCASHBOX sql server will give you both the records for fmCashbox & FmCASHBOX) so to keep the behaviour consistent what you could do is to change collation of sql server database and use a case sensitive collation so that it works in same way as firebird.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-04 : 07:39:45
As an example Latin1_General_CS_AS collation is case sensitive
Go to Top of Page

Helloise Smit
Starting Member

22 Posts

Posted - 2008-09-04 : 07:40:27
thank you i understand, but i dont want to write to sql ANY duplicates...i want to write only ONE instance...
Go to Top of Page

Helloise Smit
Starting Member

22 Posts

Posted - 2008-09-04 : 07:51:13
if i set sql to be case sensitive where and how do i do that. i use database workbench as my ide
thank you
helloise
Go to Top of Page

Helloise Smit
Starting Member

22 Posts

Posted - 2008-09-04 : 07:55:08
not to worry i know now...
thank for the help!
helloise
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-04 : 07:59:58
quote:
Originally posted by Helloise Smit

not to worry i know now...
thank for the help!
helloise


you're welcome
Go to Top of Page

Helloise Smit
Starting Member

22 Posts

Posted - 2008-09-04 : 08:18:15
in any case how would i convert firebird data to uppercase in
all columns without specifying the columns???

SELECT UPPERCASE(*) FROM " + "" + tableNames[l] + ""; ???? there are sometimes over a 50 columns in a table

i unfortunately am not llowed to change the collation to be case INsensitive in sql server. i have to prevent users to enter data in different cases. there ae reasons for it ex: a user creates a creditor name "ALLSOFT", they create another creditor "allsoft". these two names refer to the SAME creditor. we want to prevent the user from doing this!

thank you
helloise
Go to Top of Page
   

- Advertisement -