SQL Server 2008 query to find rows containing non-alphanumeric characters in a column

Won’t this do it? SELECT * FROM TABLE WHERE COLUMN_NAME LIKE ‘%[^a-zA-Z0-9]%’ Setup use tempdb create table mytable ( mycol varchar(40) NULL) insert into mytable VALUES (‘abcd’) insert into mytable VALUES (‘ABCD’) insert into mytable VALUES (‘1234’) insert into mytable VALUES (‘efg%^&hji’) insert into mytable VALUES (NULL) insert into mytable VALUES (”) insert into mytable … Read more

Stripping everything but alphanumeric chars from a string in Python

I just timed some functions out of curiosity. In these tests I’m removing non-alphanumeric characters from the string string.printable (part of the built-in string module). The use of compiled ‘[\W_]+’ and pattern.sub(”, str) was found to be fastest. $ python -m timeit -s \ “import string” \ “”.join(ch for ch in string.printable if ch.isalnum())” 10000 … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)