日期:2014-05-18  浏览次数:20544 次

帮我看看这个存储过程哪里错了? 对存储过程一窍不通
SQL code
ALTER proc [dbo].[proc_GetPrjWhere]
    @Dptid int,
    @Userid int,
    @PrjCode varchar(20),
    @BCreatdate datetime,
    @ECreatdate datetime
as
declare @where varchar(200)
set @where = '1=1'
exec('select * from Info_prjvalues where ='+@where+'')
    


执行后说 “=”号附近有语法错误

------解决方案--------------------
SQL code

declare @where varchar(200)
set @where = '1=1'
DECLARE @sql VARCHAR(500)
SET @sql='select * from Info_prjvalues where ='+@where+''
SELECT @sql
/*
select * from Info_prjvalues where =1=1
*/