Akka eredeti hozzászólása
Update, sikerüt megoldani egy rendkívül
elegáns megoldással
UPDATE adatbazis SET status ="0" WHERE adat NOT LIKE "%a%" and title NOT LIKE "%b%" and title NOT LIKE "%c%" and title NOT LIKE "%d%" and title NOT LIKE "%e%" and title NOT LIKE "%f%" and title NOT LIKE "%g%" and title NOT LIKE "%h%" and title NOT LIKE "%i%" and title NOT LIKE "%j%" and title NOT LIKE "%k%" and title NOT LIKE "%l%" and title NOT LIKE "%m%" and title NOT LIKE "%n%" and title NOT LIKE "%o%" and title NOT LIKE "%p%" and title NOT LIKE "%q%" and title NOT LIKE "%r%" and title NOT LIKE "%s%" and title NOT LIKE "%t%" and title NOT LIKE "%u%" and title NOT LIKE "%v%" and title NOT LIKE "%w%" and title NOT LIKE "%x%" and title NOT LIKE "%y%" and title NOT LIKE "%z%";
nem tudom aktualis-e meg, de ha ez folyamatos keresgeles lesz akkor a like-nal lehet erdemes lenne gyorsabb megoldast talalni, foleg ha nagy az adatbazis.
Probalhatod szimplan CAST-olt stringet osszehasonlitani az eredetivel ha csak 8bites karaktereket akarsz megtartani:
Kód:
UPDATE adatbazis SET status ="0" WHERE title<>CAST(title AS VARCHAR)
Vagy probalhatod tsql pathindex-el:
Kód:
UPDATE adatbazis SET status ="0" WHERE PATINDEX('%[A-Z]%',UCASE(title))<=0
Vagy hasznalhatsz store procedure-t es azt hivod meg a query-ben
Ha csak egyzer-egyszer kell megnezned akkor igazabol tok mindegy.
Könyvjelzők