Using special characters in LIKE and NOT LIKE operator - SQL SERVER 2005

Vilasgite080
Posted by Vilasgite080 under Sql Server category on | Points: 40 | Views : 5076
Special Characters are used for finding specific character string using LIKE operator in SQL SERVER.
Let's start to create database - trail

-----create database 
create database trail

use trail -----use database for performance on this database

----create table Faculty
create table Faculty
(
Fac_id varchar(15) not null primary key,
Fac_Name varchar(50) not null,
Subject_id varchar(50) not null
)

insert into Faculty (Fac_id,Fac_Name, Subject_id) values ('F001','Khushal','201');
insert into Faculty (Fac_id,Fac_Name, Subject_id) values ('F002','Radhika','202');
insert into Faculty (Fac_id,Fac_Name, Subject_id) values ('F003','Satish','203');
insert into Faculty (Fac_id,Fac_Name, Subject_id) values ('F004','vilas gite','205');
insert into Faculty (Fac_id,Fac_Name, Subject_id) values ('F005','rado','201');

select * from faculty
where fac_Name like 'v%'


select * from faculty
where fac_Name like '_a%'

select * from faculty
where fac_Name like 'ra[d]%'

select * from faculty
where fac_Name not like 'ra[d]%'

Comments or Responses

Posted by: T.saravanan on: 6/28/2011 Level:Silver | Status: [Member] [MVP] | Points: 10
Hi Vilasgite080 ,

Nice info.
Kindly provide the output of those query and also give the use of 'like' operator and wild card characters.
Posted by: Vilasgite080 on: 6/29/2011 Level:Starter | Status: [Member] | Points: 10
Yeah Saravanan ..
In coming codes i will defiantly.......
Thanks for comments
Posted by: T.saravanan on: 6/29/2011 Level:Silver | Status: [Member] [MVP] | Points: 10
Hi,

Just go and edit your code then add the output of those query and finally submit the button.
With out output no one can not understand then only i say.

Login to post response