日期:2014-05-18 浏览次数:20551 次
declare @Sql varchar(1000) declare @ACCOUNT varchar(50)='AA' --@ACCOUNT 为 testName 时也需要符合 Set @Sql ='select * from T_ORDER where (' + CASE @ACCOUNT WHEN '-1' THEN '1=1' ELSE 'ACCOUNT = '''+ CAST(@ACCOUNT AS varchar(50)) + '''' END + ') ' select @Sql;