sql server - Search Entire Database To find extended ascii codes in sql -


we have issues extended ascii codes getting in our database (128-155)

is there anyway search entire database , display results of of these characters may in there , located within tables , columns.

hope makes sense.

i have script search entire db, having trouble opening line.

declare @searchstr nvarchar(100)  set @searchstr != between char(32) , char(127) 

i have works, need extend range i'm looking for.

set @searchstr = '|' + char(9) + '|' + char(10) + '|' + char(13) 

thanks

it's unclear data looks like, might started:

declare @testdata table (string nvarchar(100))  insert @testdata select n'abc' insert @testdata select n'def' insert @testdata select char(128) insert @testdata select char(155)  declare @searchpattern nvarchar(max) = n'%[' declare @i int = 128 while @i <= 155 begin     set @searchpattern += char(@i)     set @i += 1 end set @searchpattern += n']%'  select @searchpattern  select string @testdata string @searchpattern 

of course you'll need add code loop on every table , column want query (see this question), , it's possible code behave differently on different collations.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -