Add sp parameter sql server without modifying the stored procedure request -
i have sample stored procedure named spexample
.
i want add parameter named testparam
stored procedure without using syntax
alter procedure spexample @testparamint begin ... end
is there syntax like: alter procedure spexample add parameter ...
or other alternative?
short answer:
no can not
detailed answer:
alter procedure has 3 different syntax below:
sql server syntax:
alter { proc | procedure } [schema_name.] procedure_name [ ; number ] [ { @parameter [ type_schema_name. ] data_type } [ varying ] [ = default ] [ out | output ] [readonly] ] [ ,...n ] [ <procedure_option> [ ,...n ] ] [ replication ] { [ begin ] sql_statement [;] [ ...n ] [ end ] } [;] <procedure_option> ::= [ encryption ] [ recompile ] [ execute clause ]
sql server clr stored procedure syntax:
alter { proc | procedure } [schema_name.] procedure_name [ ; number ] [ { @parameter [ type_schema_name. ] data_type } [ = default ] [ out | output ] [readonly] ] [ ,...n ] [ execute clause ] { external name assembly_name.class_name.method_name } [;]
azure sql database syntax:
alter { proc | procedure } [schema_name.] procedure_name [ { @parameter [type_schema_name. ] data_type } [ varying ] [= default ] [ [ out [ put ] ] [,...n ] [ <procedure_option> [ , ...n ] ] [ replication ] { <sql_statement> [...n ] } [;] <procedure_option> ::= [ encryption ] [ recompile ] [ execute_as_clause ] <sql_statement> ::= { [ begin ] statements [ end ] }
note in 3 syntaxes above, sql_statement
1 of mandatory parts of syntax. parts inside [
, ]
optional, read more transact-sql syntax conventions here: https://msdn.microsoft.com/en-us/library/ms177563.aspx
as see in above syntaxes there not syntax 1 requested.
read more here: https://msdn.microsoft.com/en-us/library/ms189762.aspx
Comments
Post a Comment