How to provide default values to stored procedure parameters?



How to provide default values to stored procedure parameters?..

Answer / Suman Kumar

"To provide default values to stored procedure parameters in MS SQL Server, use the following syntax:nn```sqlncreate procedure sp_namen@param_name datatype = default_valuen...n``"nReplace 'sp_name', 'param_name', 'datatype', and 'default_value' with your specific stored procedure name, parameter name, data type, and default value.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

List out the differences between the clustered index and non-clustered index in sql server?

1 Answers  


WHICH INDEX IS FAST CLUSTER AND NON CLUSTER INDEX

4 Answers   CarrizalSoft Technologies, L&T,


how can u select the Distinct values in the table, table having 20 columns , i want all columns

2 Answers  


How to use copy and concatenate commands in SQL?

1 Answers   Amdocs,


what is bit datatype and what's the information that can be stored inside a bit column? : Sql server database administration

1 Answers  


What is the diffrence between update_one and auto_fix?

3 Answers   IBM,


What is Command line parameters in PLSQL.?

1 Answers   MCN Solutions,


hi to all teachers,... Friends who write in the query mode Full text Search in Sql Server have experience Who make(Convert) this Stored Procedure as a normal Full text Search, which contains and .. Is used, into Advance of the tips I have thanked all friends perfection. Email : rezaafandi@yahoo.com Create PROCEDURE Sp_student @fname varchar(50), @lname varchar(50), @tel varchar(50), @code varchar(50), @adr varchar(50), @search_operation varchar(50), @totalRowCount bigint output AS begin if @search_operation = 'and' begin SELECT f3,f4,f5,f6,f7 FROM tb_student WHERE( f5 like '%' + @fname + '%' and f4 like '%' + @lname + '%' and f6 like '%' + @tel + '%' and f7 like '%' + @code + '%' and f3 like '%' + @adr +'%' ) select @totalRowCount = @@rowcount end

0 Answers  


Mention the different authentication modes in sql server.

1 Answers  


How to get @@error and @@rowcount at the same time?

1 Answers  


Explain the collation?

1 Answers  


What is pessimistic concurrency?

1 Answers  


Categories