日期:2014-05-18 浏览次数:20606 次
declare @str varchar(20) set @str = 'A0' create table #Test(ph varchar(20),mq varchar(20)) insert into #Test (ph , mq) select ph , mq from aa where ISNUMERIC(@str) = 1 union all select ph , mq from bbb where ISNUMERIC(@str) <> 1
------解决方案--------------------
declare @str varchar(20) set @str = 'A0' create table #Test(ph varchar(20),mq varchar(20)) /*执行时提示 IF 附件有语法错误*/ if ISNUMERIC(@str) = 1 begin insert into #Test (ph , mq) select ph , mq from aa end else begin insert into #Test (ph , mq) select ph , mq from bbb end
------解决方案--------------------
IF语法没问题哇.
是其他出错吧.
insert into #Test (ph , mq)
------解决方案--------------------