码迷,mamicode.com
首页 > 其他好文 > 详细

创建存储过程

时间:2018-05-15 17:47:12      阅读:132      评论:0      收藏:0      [点我收藏+]

标签:创建   存储   过程   

use TEST go create PROCEDURE [dbo].[SP_物料出入库周期] ( @起始日期 VARCHAR(8), @结束日期 VARCHAR(8) ) AS BEGIN SET NOCOUNT ON; --当 SET NOCOUNT 为 ON 时,不返回计数。当 SET NOCOUNT 为 OFF 时,返回计数。 ----------------删除临时表------------------------------------ --if object_id(‘tempdb..#TempA‘) is not null drop table #TempA; -------------------------------------------------------------- select INVMC.MC001 as ‘品号‘ ,MB002 as ‘品名‘ ,INVMC.MC002 as ‘仓库‘ ,CMSMC.MC002 as ‘仓库名称‘ ,INVMC.MC007 as ‘库存数量‘ ,INVMC.MC011 as ‘上次盘点日‘ ,INVMC.MC012 as ‘最近入库日‘ ,INVMC.MC013 as ‘最近出库日‘ from INVMC ,INVMB ,CMSMC where INVMC.MC001 = MB001 and INVMC.MC002 = CMSMC.MC001 and ((INVMC.MC012 BETWEEN @起始日期 AND @结束日期 ) or (INVMC.MC013 BETWEEN @起始日期 AND @结束日期 )) and INVMC.MC002 in (‘101‘,‘102‘,‘103‘,‘104‘,‘106‘,‘110‘) --------------------------------------------------------------- End

创建存储过程

标签:创建   存储   过程   

原文地址:http://blog.51cto.com/gongxi/2116242

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!