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)
 Replacing illigal hindi characters from field?

Author  Topic 

amit1902
Starting Member

6 Posts

Posted - 2011-08-19 : 04:03:29
I am using SQL server 2005 and one of my field in house_no as nvarchar, which contains hindi, numeric and both combination values like -
  • 1
  • 2/1
  • 31/1?
  • 3 ?????? ????? ??
  • ?? ????? ???
  • 12??
  • 14?
  • ???

Now I want to delete the all illegal charterers like ?? or ? and many more from string and preserving rest. I have used replace() function but it is not working on hindi characters. Please suggest me the solution. My database is big nearly about 200GB and I have to replace all such characters.

Amit Sharma

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-08-19 : 04:08:34
why is it storing as '?' is the datatype nvarchar?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

amit1902
Starting Member

6 Posts

Posted - 2011-08-19 : 04:21:00
I am not able to post the hindi characters. Every hindi font is converted to ????. I don't know why?

Amit Sharma
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-08-19 : 04:31:49
oh ok...
did you try replace after taking ASCII values of characters?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

amit1902
Starting Member

6 Posts

Posted - 2011-08-19 : 04:35:36
I am trying to post my question again -
I am using SQL server 2005 and one of my field in house_no as nvarchar, which contains hindi, numeric and both combination values like -
 1
  2/1
  31/1?? 
  3 ????? ??? 
  ?? ????? ??? 
  12???
 
 14? 
???

Now I want to delete the all illegal charterers like
 ? or ???

Now I want to delete the all illegal charterers like
?
or
???[/code] and many more from string and preserving rest. I have used replace() function but it is not working on hindi characters. Please suggest me the solution. My database is big nearly about 200GB and I have to replace all such characters.

Amit Sharma
Go to Top of Page

amit1902
Starting Member

6 Posts

Posted - 2011-08-19 : 04:37:21
Every characters of hindi gives 63 value as ASCII.

Amit Sharma
Go to Top of Page

amit1902
Starting Member

6 Posts

Posted - 2011-08-19 : 04:39:27
Please look at this link for my question because this forum is not allowing me to post hindi characters.
http://stackoverflow.com/questions/7118826/remove-illigal-characaters-from-sql-server-2005-database


Amit Sharma
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-08-19 : 04:39:33
then its easier right?

REPLACE(string,CHAR(63),'')

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

amit1902
Starting Member

6 Posts

Posted - 2011-08-19 : 04:44:02
I can't use REPLACE(string,CHAR(63),'') because I have to delete illegal hindi character not all hindi characters. Please Look at below link for my problem
http://stackoverflow.com/questions/7118826/remove-illigal-characaters-from-sql-server-2005-database


Amit Sharma
Go to Top of Page
   

- Advertisement -