Last active
August 29, 2015 14:02
-
-
Save fnalin/1d4fa0c874e49f216c45 to your computer and use it in GitHub Desktop.
Pesquisa simples através do like no SQL buscando com caracteres coringas.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE MASTER | |
GO | |
IF(SELECT Count(name) FROM sys.databases WHERE name = 'TESTELike')=1 | |
BEGIN | |
ALTER DATABASE TESTELike SET SINGLE_USER WITH ROLLBACK IMMEDIATE; | |
DROP DATABASE TESTELike; | |
END | |
GO | |
CREATE DATABASE TESTELike | |
GO | |
USE TESTELike | |
GO | |
CREATE TABLE Nomes | |
( | |
ID INT IDENTITY(1,1) PRIMARY KEY, | |
Nome VARCHAR(100) NOT NULL | |
); | |
INSERT INTO Nomes(Nome) | |
VALUES ('Fabio'),('Fábio'),('Nome3'),('Nome4'); | |
SELECT * FROM Nomes WHERE Nome LIKE 'F[a,á]bio'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment