sql server Stored procedure parameter

Posted on 2011-04-24
Medium Priority
Last Modified: 2012-05-11

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

@firstname varchar(30) ='%'    

 what does it mean ?
Question by:N_Sri

Accepted Solution

kaminda earned 2000 total points
ID: 35457960
% 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

Author Closing Comment

ID: 35458196

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question