Any of the wildcard characters (%, _ [, ], or ?) enclosed in square brackets stand for themselves : Regular Expressions « String Functions « SQL Server / T-SQL






Any of the wildcard characters (%, _ [, ], or ?) enclosed in square brackets stand for themselves


1> CREATE TABLE project   (project_no   CHAR(4) NOT NULL,
2>                         project_name CHAR(15) NOT NULL,
3>                         budget FLOAT NULL)
4> GO
1> insert into project values ('p1', 'Search Engine',        120000.00)
2> insert into project values ('p2', 'Programming',          95000.00)
3> insert into project values ('p3', 'SQL',                  186500.00)
4> GO

(1 rows affected)

(1 rows affected)

(1 rows affected)
1>
2> -- Any of the wildcard characters (%, _ [, ], or ?) enclosed in 
square brackets stand for themselves.
3>
4> SELECT project_no, project_name
5>        FROM project
6>        WHERE project_name LIKE '%[_]%'
7> GO
project_no project_name
---------- ---------------

(0 rows affected)
1> drop table project
2> GO
1>
           
       








Related examples in the same category

1.Begin with a character in the range C through F
2.^ specifies the negation of a range or a list of characters
3.'_' is for one letter
4.'%' is for any length of letters