Create procedure test1 @str_date char(10)
as
declare @js int
begin
select @js=sum(js) from k_send where date=@str_date
insert into k_sum (js,date) values (@js,@str_date)
end那边copy过来的,哈哈
as
declare @js int
begin
select @js=sum(js) from k_send where date=@str_date
insert into k_sum (js,date) values (@js,@str_date)
end那边copy过来的,哈哈
as
exec('select * from table where '+@str)
go
declare @temp varchar(255)
select @temp=' where b=1'
select @str='select * from a'+@temp
exec(@str)
按照这种写法
as
declare @js VARCHAR(8000)
begin
select @js= 'SELECT * FROM TABLE ' + @STR
EXEC(@JS)
end
as
declare @sql varchar(400)
set @sql='select * from test where '+@Sql_where
exec (@sql)
go