Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find Unicode/non-ASCII characters in an NTEXT field in a SQL Server 2005 table?

I have a table with a couple thousand rows. The description and summary fields are NTEXT, and sometimes have non-ASCII chars in them. How can I locate all of the rows with non ASCII characters?

like image 628
TheSoftwareJedi Avatar asked Mar 26 '09 18:03

TheSoftwareJedi


People also ask

How do I find a non Unicode character?

To identify the Non Unicode characters we can use either Google Chrome or Mozilla firefox browser by just dragging and dropping the file to the browser. Chrome will show us only the row and column number of the .


1 Answers

I have sometimes been using this "cast" statement to find "strange" chars

select      * from      <Table> where      <Field> != cast(<Field> as varchar(1000)) 
like image 78
CC1960 Avatar answered Oct 17 '22 23:10

CC1960