惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
Schneier on Security
The Last Watchdog
The Last Watchdog
Cyberwarzone
Cyberwarzone
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cyber Attacks, Cyber Crime and Cyber Security
L
Lohrmann on Cybersecurity
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 司徒正美
The Cloudflare Blog
V
V2EX
博客园_首页
博客园 - 聂微东
Vercel News
Vercel News
人人都是产品经理
人人都是产品经理
G
GRAHAM CLULEY
T
Tenable Blog
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
L
LINUX DO - 最新话题
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
SecWiki News
SecWiki News
博客园 - 三生石上(FineUI控件)
S
Secure Thoughts
N
News | PayPal Newsroom
T
The Blog of Author Tim Ferriss
The GitHub Blog
The GitHub Blog
T
Troy Hunt's Blog
博客园 - 【当耐特】
Forbes - Security
Forbes - Security
H
Hacker News: Front Page
A
About on SuperTechFans
B
Blog RSS Feed
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
D
DataBreaches.Net
P
Privacy & Cybersecurity Law Blog
Schneier on Security
Schneier on Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Google DeepMind News
Google DeepMind News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Jina AI
Jina AI
D
Docker
P
Proofpoint News Feed

博客园 - prayforsmile

向android虚拟机中push文件提示Read-only file system 存储 时间对应多条记录 =iif(RowNumber("table6_Group3")=1,"Solid","None") - prayforsmile - 博客园 StringSplitToTable SP 拼音 临时表 调用另一个存储过程 返回主键 时间 sp数组处理 同一个表取取相同列内容剔除,附加 SP插入 rrr 再见吧,09 ddl - prayforsmile - 博客园 ~~ 关于Case项目 2009悲剧男
1
prayforsmile · 2010-05-19 · via 博客园 - prayforsmile

-- =============================================
-- Author:  <Author,,Name>
-- Create date: <Create Date,,>
-- Description: 获得入库单表头信息
-- =============================================
ALTER PROCEDURE [dbo].[Get_InStock]
 @InStock_Ord varchar(20),
    @Sp_Id          int=-1,
    @State          int=-1
AS
BEGIN
 DECLARE @InStkCount    int
 DECLARE @InStock_Id    decimal
 DECLARE @OutStor_id    decimal
 DECLARE @TotalAmt    money
 DECLARE @TotalPerFee   money
 DECLARE @GoldPrice    money
 SELECT @InStkCount=COUNT(InStock_Id) FROM [ExInStock] 
  WHERE (InStock_Ord=@InStock_Ord OR @InStock_Ord='') AND
              (Sp_Id=@Sp_Id OR @Sp_Id=-1) AND
              (state=@state OR @state=-1) AND
              InStockType=1
 SELECT @OutStor_id=OutStor_id,
      @TotalAmt=TotalAmt,
   @TotalPerFee=TotalPerFee,
   @GoldPrice=GoldPrice
  FROM OutStorageOrd A 
--  INNER JOIN Depart_From_Batar B ON B.Dept_Id=A.Customer_Id
  WHERE OutStor_Number=@InStock_Ord AND
--   (@Sp_Id=-1 OR B.Number=(SELECT Number FROM DepartmentInfo WHERE Dept_Id=@Sp_Id))
            (A.Customer_Id=@Sp_Id OR @Sp_Id=-1)
 IF(@InStkCount=0 AND @OutStor_id IS NOT NULL)
 BEGIN TRY
  BEGIN TRAN
  INSERT [ExInStock]
           (InStock_Ord,OutStor_id,Sp_Id,Cost,PerFee,GoldPrice,InStockType,State)
           values(@InStock_Ord,@OutStor_id,@Sp_Id,@TotalAmt,@TotalPerFee,@GoldPrice,1,1)
  SELECT @InStock_Id=@@IDENTITY
  INSERT [ExInStockInfo]
           (BarCode,InStock_Id,Gp_Id,Pm_Id,Pq_Id,AllWeight,GoldWeight,InStock_Ord,InStockType,Sp_Id)
  SELECT A.BarCode,@InStock_Id,A.Gp_Id,A.Pm_Id,d.Pq_Id,A.Weight,A.Net_Weight,b.OutStor_Number,1,@Sp_Id
  FROM GoldProduct AS A
  INNER JOIN OutStorageOrd AS B ON A.OutStor_id=B.OutStor_id
  INNER JOIN ProductModel AS c ON c.Pm_Id=A.Pm_Id
        LEFT OUTER JOIN ProductQuality AS D ON D.Pq_Id_Batar=C.Pq_Id
  WHERE B.OutStor_Number=@InStock_Ord
  
--  FROM GoldProduct AS A,OutStorageOrd AS B,ProductQuality AS C,ProductModel AS D
--  WHERE B.OutStor_Number=@InStock_Ord AND A.OutStor_id=B.OutStor_id
--     AND D.Pm_Id=A.Pm_Id AND C.Pq_Id_Batar=D.Pq_Id
--SELECT @BarCode,@InStock_Id,@Gp_Id,@Pm_Id,@AllWeight,@GoldWeight,
--     @InStock_Ord
  COMMIT TRAN   
 END TRY
 BEGIN CATCH
  IF (@@ERROR<>0)
  BEGIN
   ROLLBACK TRAN
   SELECT ERROR_MESSAGE()
  END
 END CATCH
 SELECT * FROM [ExInStock]
  WHERE (InStock_Ord=@InStock_Ord OR @InStock_Ord='') AND
     (Sp_Id=@Sp_Id OR @Sp_Id=-1) AND
     (state=@state OR @state=-1) AND
              InStockType=1
END

posted on 2010-05-19 16:20  prayforsmile  阅读(179)  评论()    收藏  举报