Skip to content

Latest commit

 

History

History
55 lines (48 loc) · 1.91 KB

File metadata and controls

55 lines (48 loc) · 1.91 KB
title (Wildcard - Character(s) Not to Match) (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 12/06/2016
ms.prod sql-non-specified
ms.reviewer
ms.suite
ms.technology
database-engine
ms.tgt_pltfrm
ms.topic language-reference
applies_to
Azure SQL Database
SQL Server (starting with 2008)
f1_keywords
wildcard
[^]_TSQL
[^]
Not Match
dev_langs
TSQL
helpviewer_keywords
wildcard characters [SQL Server]
[^] (wildcard - character(s) not to match)
ms.assetid b970038f-f4e7-4a5d-96f6-51e3248c6aef
caps.latest.revision 36
author BYHAM
ms.author rickbyh
manager jhubbard

(Wildcard - Character(s) Not to Match) (Transact-SQL)

[!INCLUDEtsql-appliesto-ss2008-asdb-xxxx-xxx_md]

Matches any single character that is not within the range or set specified between the square brackets.

Examples

The following example uses the [^] operator to find all the people in the Contact table who have first names that start with Al and have a third letter that is not the letter a.

-- Uses AdventureWorks  
  
SELECT FirstName, LastName  
FROM Person.Person  
WHERE FirstName LIKE 'Al[^a]%'  
ORDER BY FirstName;  

See Also

LIKE (Transact-SQL)
PATINDEX (Transact-SQL)
% (Wildcard - Character(s) to Match) (Transact-SQL)
[ ] (Wildcard - Character(s) to Match)
_ (Wildcard - Match One Character)