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

推荐订阅源

H
Hacker News: Front Page
A
About on SuperTechFans
腾讯CDC
罗磊的独立博客
博客园 - Franky
Last Week in AI
Last Week in AI
博客园_首页
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
小众软件
小众软件
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Register - Security
The Register - Security
云风的 BLOG
云风的 BLOG
L
LangChain Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
D
Docker
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Recorded Future
Recorded Future
Vercel News
Vercel News
Martin Fowler
Martin Fowler
WordPress大学
WordPress大学
J
Java Code Geeks
有赞技术团队
有赞技术团队
V
V2EX
IT之家
IT之家
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
雷峰网
雷峰网
Jina AI
Jina AI
B
Blog RSS Feed
H
Help Net Security
N
Netflix TechBlog - Medium
Latest news
Latest news
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 司徒正美
Y
Y Combinator Blog
人人都是产品经理
人人都是产品经理
Stack Overflow Blog
Stack Overflow Blog
C
Cisco Blogs
Microsoft Security Blog
Microsoft Security Blog
阮一峰的网络日志
阮一峰的网络日志
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
大猫的无限游戏
大猫的无限游戏
C
Check Point Blog
P
Proofpoint News Feed
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
N
News and Events Feed by Topic
T
Threatpost

博客园 - 一味

[翻译]实例:在Android调用WCF服务 基于LRU淘汰的高性能缓存 不是架构的架构之五:业务层的实现与自动代理(补充) 不是架构的架构之四:业务层的实现与自动代理 不是架构的架构之三:系统基础(2)主键选择和并发 不是架构的架构之二:系统基础(1) 不是架构的架构之一:总体思路 一道算法题 技术先行or业务先行 用了一年的键盘,记录下键盘磨损的状况 一个业务系统设计构想(一) 安装VS2008/.Net3.5/.Net3.0/.Net2.0sp1失败的解决办法 常用存储过程3(获取编码的上级编码和短编码) 常用存储过程2(获取编码级次) 常用存储过程1(获取字符串中的第一个数值) SQL Server中Rollup关键字使用技巧 Math.Round函数四舍五入的问题 SQL Server进程阻塞的检查和解决办法(转自好友Blog) 学习NHibernate的感悟和疑惑
常用存储过程4(K310。3版本获取物流新单据的编码)
一味 · 2008-04-15 · via 博客园 - 一味

Create Proc GetICBillNo
 
@billtype int,
 
@isuse bit,
 
@billno varchar(100) out
as

set @billno=''

select a.*,isnull(b.ftable,''as ftable,isnull(e.ffieldname,''as FieldName
into #tmp
from t_billcoderule a
 
left join t_option e on a.fprojectid=e.fprojectid and a.fformatindex=e.fid
 
Left OUter join t_checkproject b on a.fbilltype=b.fbilltypeid and a.fprojectval=b.ffield
 
where a.fbilltypeid = @billtype order by a.FClassIndex

declare @pid int,@pval varchar(20),@length int,@format varchar(20)
DECLARE cc CURSOR FOR 
SELECT FProjectID, FProjectVal, FLength,FFormatIndex
FROM #tmp
ORDER BY FClassIndex

OPEN cc

FETCH NEXT FROM cc 
INTO @pid,@pval,@length,@format

WHILE @@FETCH_STATUS = 0
BEGIN
 
if(@pid=1)
 
begin
  
set @billno=@billno+@pval
 
end
 
else if(@pid=3)
 
begin
  
declare @v varchar(100)
  
set @v='00000000000000000000000000000000000000000000000000000000'
  
set @billno=@billno+left(@v,@length-len(@pval))+@pval
 
end

 
FETCH NEXT FROM cc 
  
INTO @pid,@pval,@length,@format
END

CLOSE cc
DEALLOCATE cc

if(@isuse=1)
 
Update t_billcoderule set FProjectVal=Cast(FProjectVal as int)+1  where fbilltypeid = @billtype and FProjectID=3 
select @billno

GO
declare @no varchar(100)
Exec GetICBillNo 80,0,@no out
print @no