How to use Exec in sql server during stored procedure
create procedure [schema].[Procedure_name]
@fielname1 varchar(16)=null,
@fielsname2 varchar(16)=null
as
select
[filedname1] ,[fieldname2] from [table_name]
where fieldname3=@fielname1
Exec [Procedure_name] ' xyz'
xyz ..the value from which you want to give condition.
create procedure [schema].[Procedure_name]
@fielname1 varchar(16)=null,
@fielsname2 varchar(16)=null
as
select
[filedname1] ,[fieldname2] from [table_name]
where fieldname3=@fielname1
Exec [Procedure_name] ' xyz'
xyz ..the value from which you want to give condition.
0 comments: