22,206
社区成员
发帖
与我相关
我的任务
分享
--try
ALTER proc AddRevmeeting(@meetingId varchar(6),@fromtime datetime,@totime datetime,
@content varchar(50),@userName varchar(12),@node varchar(50),
@str varchar(200) output
)
as
DECLARE @rId char(6)
DECLARE @rmeetingId char(6)
DECLARE @rfromtime datetime
DECLARE @rtotime datetime
DECLARE @rcontent varchar(50)
DECLARE @ruserName varchar(12)
/*set @str=null*/
/*set nocount on*/
select @str=isnull(Id,''),@rmeetingId=isnull(meetingId,''),@rfromtime=isnull(fromtime,''),@rtotime=isnull(totime,''),
@rcontent=isnull(content,''),@ruserName=isnull(userName,'') from Revmeeting where meetingId=@meetingId
/*and(fromtime<=@totime and totime>=@fromtime )*/
if(@@rowcount>0)
begin
set @str='預定發生衝突,沖突記錄如下:\r\n會議編號:'+@rId+
'\r\n會議室編號:'+@rmeetingId+
'\r\n預定時間:'+cast(@rfromtime as varchar)+
'\r\n結束時間:'+cast(@rtotime as varchar)+
'\r\n會議名稱:'+@rcontent+
'\r\n預定人:'+@ruserName+'.'
select @str
return 1
end
else
insert into Revmeeting values(@meetingId,@fromtime,@totime,
@content,@userName,@node)
ALTER proc AddRevmeeting(@meetingId varchar(6),@fromtime datetime,@totime datetime,
@content varchar(50),@userName varchar(12),@node varchar(50),
@str varchar(200) output
)
as
DECLARE @rId char(6)
DECLARE @rmeetingId char(6)
DECLARE @rfromtime datetime
DECLARE @rtotime datetime
DECLARE @rcontent varchar(50)
DECLARE @ruserName varchar(12)
/*set @str=null*/
/*set nocount on*/
select @str=Id,@rmeetingId=meetingId,@rfromtime=fromtime,@rtotime=totime,
@rcontent=content,@ruserName=userName from Revmeeting where meetingId=@meetingId
/*and(fromtime<=@totime and totime>=@fromtime )*/
if(@@rowcount>0)
begin
set @str='預定發生衝突,沖突記錄如下:\r\n會議編號:'+isnull(@rId,'')+
'\r\n會議室編號:'+isnull(@rmeetingId,'')+
'\r\n預定時間:'+cast(isnull(@rfromtime,'') as varchar)+
'\r\n結束時間:'+cast(isnull(@rtotime,'') as varchar)+
'\r\n會議名稱:'+isnull(@rcontent,'')+
'\r\n預定人:'+isnull(@ruserName,'')+'.'
select @str
return 1
end
else
insert into Revmeeting values(@meetingId,@fromtime,@totime,
@content,@userName,@node)
ALTER proc AddRevmeeting(@meetingId varchar(6),@fromtime datetime,@totime datetime,
@content varchar(50),@userName varchar(12),@node varchar(50),
@str varchar(200) output
)
as
DECLARE @rId char(6)
DECLARE @rmeetingId char(6)
DECLARE @rfromtime datetime
DECLARE @rtotime datetime
DECLARE @rcontent varchar(50)
DECLARE @ruserName varchar(12)
/*set @str=null*/
/*set nocount on*/
select @str=Id,@rmeetingId=meetingId,@rfromtime=fromtime,@rtotime=totime,
@rcontent=content,@ruserName=userName from Revmeeting where meetingId=@meetingId
/*and(fromtime<=@totime and totime>=@fromtime )*/
if(@@rowcount>0)
begin
set @str='預定發生衝突,沖突記錄如下:\r\n會議編號:'+@rId+
'\r\n會議室編號:'+isnull(@rmeetingId,'')+
'\r\n預定時間:'+cast(isnull(@rfromtime,'') as varchar)+
'\r\n結束時間:'+cast(isnull(@rtotime,'') as varchar)+
'\r\n會議名稱:'+isnull(@rcontent,'')+
'\r\n預定人:'+isnull(@ruserName,'')+'.'
select @str
return 1
end
else
insert into Revmeeting values(@meetingId,@fromtime,@totime,
@content,@userName,@node)