SQL Server LIKE containing bracket characters

Using SQL Server 2008. I have a table with the following column:

sampleData (nvarchar(max))

The value for this column in some of these rows are lists formatted as follows:

["value1","value2","value3"]

I'm trying to write a simple query that will return all rows with lists formatted like this, by just detecting the opening bracket.

SELECT * from sampleTable where sampleData like '[%'

The above query doesn't work because '[' is a special character, and I can't for the life of me figure out how to escape the bracket so my query does what I want.

Thanks for any suggestions!

51
задан gbn 7 September 2010 в 06:39
поделиться