TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Optional Parameters in Stored Procedure
Khargesh Rajput
Feb 06
2015
Code
955
0
1
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
create
proc test
(
@parameter
int
=
null
)
as
begin
if(@parameter
is
null
)
select
*
from
tablename
else
select
*
from
tablename
where
columnname=@parameter
end
exec
test
or
exec
id (value)
No error for parameter @id not passed in stored procedure.
SQL Server
Stored Procedure