Thursday, May 3, 2012

StoredProcedure Search

Select * from MsStudent


--Create a procedure:
Create proc SearchName
@Name Varchar(30) = ''
as
select * from MsStudent where Name like '%'+@Name+'%'


You can see all data from MsStudent shown.






It just show 2 data of student that has word 'ra' in their name.



Be careful when you make the search procedure. @Name as parameter must be Varchar.

No comments:

Post a Comment