Groups | Blog | Home
all groups > sql server new users > april 2005 >

sql server new users : special characters like '[' or ']' in datarows


Mike Epprecht (SQL MVP)
4/18/2005 12:00:00 AM
Hi

If you double it up at query time, SQL Disregards it

Select *
from Musikdatei
Where m_Dateipfad LIKE 'C:\Xavier-Naidoo - Ich kenne nichts [[deutsche
version]].mp3'

Regards
--------------------------------
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland

IM: mike@epprecht.net

MVP Program: http://www.microsoft.com/mvp

Blog: http://www.msmvps.com/epprecht/

[quoted text, click to view]

Jacco Schalkwijk
4/18/2005 12:00:00 AM
You don't need LIKE, you can just use an = sign if you are not using any
wildcards. If you have a use for LIKE, you will have to escape the right
bracket with [[]:

Select *
from Musikdatei
Where m_Dateipfad LIKE REPLACE('C:\Xavier-Naidoo - Ich kenne nichts
[deutsche
version].mp3', '[', '[[]')


--
Jacco Schalkwijk
SQL Server MVP


[quoted text, click to view]

elime4x NO[at]SPAM hotmail.com
4/18/2005 3:00:00 AM
Hi all

I am working on a mp3-Managment-tool with a SQL-Database.
I got into troubles with a few files that have '[' and ']' in their
filepathes or in any mp3-TagInfo.

When I do some queries on these files e.g

Select *
from Musikdatei
Where m_Dateipfad LIKE 'C:\Xavier-Naidoo - Ich kenne nichts [deutsche
version].mp3'

it doesn't seem to find anything at all (although the files in checked
in in the database). The same problem I have with any artistname etc
that have these special characters.

How can I get around this? is there any key-command to tell SQL that
'[' should be taken as '[' and not as any "functional character"?


Thanks for any help!!!

AddThis Social Bookmark Button