存储过程 写法

 strSQL = "exec daycount " + Session("grade") + ",'" + Session("police") + "','" + AToDay + "'"

CREATE Procedure daycount
@Grad int,
@police Varchar(10),
@currenttime varchar(20)

as
if @Grad=0
begin
select (select hotelname from info_hotel where info_hotel.hotelcode=Info_Guest.hotelcode) as hotelname,Count(guestcode) as UpDataNum from info_Guest where substring(LoginTime,1,8)=@currenttime and hotelcode in (select PH.hotelcode from Info_hotel as PH where PH.ting=@police and hotelstatus = 1) group by HotelCode  ORDER BY UpDataNum
end
  
GO

转载于:https://www.cnblogs.com/liufei88866/archive/2009/08/06/1540579.html

表情包
插入表情
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
相关推荐
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页