一个参数类型不明白的地方,求教,写
CREATE procedure up_good
@good_test char(25),@bad_test char(25),@aa datetime
as
--pub_id
declare @aaa char(1000)
set @aaa='select *,sdate=cast('''+CONVERT(varchar(10),@aa,120)+''' as datetime) into good from titles where pub_id >='''+@good_test +''' and pub_id<='''+@bad_test+''''
exec (@aaa)
GO
exec up_good '0700','1300','1991/1/1'
我想不明白,为什么你要把@aa先转变为varchar(10),再把他转变成datetime,@aa原本就是datetime类型了。