sql server Stored procedure parameter

 I have seen   sql server Stored procedure example in one of tutorials  as following

@firstname varchar(30) ='%'    

 what does it mean ?
Who is Participating?
kamindaConnect With a Mentor Commented:
% is the wildcard search syntax in SQL Server. When you use it with LIKE operater it will return the values as below;

SELECT * FROM table WHERE FirstName LIKE '%'  -- Will return all the rows
SELECT * FROM table WHERE FirstName LIKE 'a%'  -- Will return firstnames starts with a


So your @firstname variable may be used in a wildcard search in the stored procedure. Hard to say what exactly it does without seeing the remining part of the procedure
N_SriAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.