22,210
社区成员
发帖
与我相关
我的任务
分享
@SQL1='update visits set '+cast(visit_type as varchar(10))+'=''11'' where '+convert(varchar(10),START_TIME,121)+
'>=@date_start and '+cast(visit_type as varchar(10))+'=''10'' and LONGITUDE<>0'
create procedure [dbo].[UpdateVisit_type]
@startdate datetime
as
begin
declare @SQL1 VARCHAR(MAX);
SET
@SQL1='update visits set ['+cast(visit_type as varchar(10))+']=''11'' where '''+convert(varchar(10),START_TIME,121)+'''>='''+convert(varchar(10),@startdate,121)+''' and cast(visit_type as varchar(10))=''10'' and LONGITUDE<>0'
EXECUTE(@SQL1);
end
把'11'改为''11''、'10'改为''10''
问一下!里面有个 @date_start ,没有见到声明耶...