create procedure check declare @p_condition varchar(50); declare @p_main varchar(50); set @p_main='SELECT * FROM MASTER; set @p_condition=where UPPER(USERNAME)=UPPER(admin); exec check
Declare @SqlStr Varchar(4000) Declare @UserName nvarchar(4000) SET @Sql = ' SELECT * from Master where userName = ' + @UserName + '' Execute(@SqlStr) --Print @SqlStr
create procedure check as begin declare @p_condition nvarchar(max) declare @p_main nvarchar(max) set @p_main='SELECT * FROM MASTER' set @p_condition=' where UPPER(USERNAME)=UPPER(admin)' declare @qry nvarchar(max) set @qry = @p_main + @p_condition exec (@qry) end
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)