文章分类 | 推荐文章 | 最新文章 | 热点文章 | 最新软件 | 国产软件 | 国外软件 | 汉化补丁 | 设为首页 | 加入收藏
业界资讯 | 图形图像 | 操作系统 | 网络冲浪 | 工具软件 | 办公软件 | 媒体动画 | 精文荟萃 | 认证考试 | 网站建设 | 技术开发 | 专栏
当前位置:abcdown网络学院网络编程数据库存储过程使用技巧
精品广告
推荐TOP10
·SQL中通配符、转义符与
·SQL数据库完全使用手册
·进阶:精妙SQL语句介绍
·sql删除记录
·学习SQL语句之SQL语句大全
·数据备份失败的五个原因及解决办法
·解决SQL Server常见的七个经典问题
·SQL存储过程的概念,创建,调用,管理,删除,优点
·带你轻松接触13个数据库术语
·如何恢复系统数据库如何恢复系统数据库?
阅读TOP10
·图片保存到数据库和从数据库读取图片并显示(c#)
·如何在GridView中一次性批量更新多行数据
·正确实现 IDisposable 接口
·从Internet时间服务器获取标准格林尼治时间
·SQL中通配符、转义符与
·Servlet动态产生JPEG图像的例子
·Webservice中使用Session、Application
·101个微软提供的Visual Studio 2005示例
·如何用sql语句修改数据表中字段,实现identity(100,1)的递增
·输出到html页面的字符串的格式化

存储过程使用技巧

日期:2006年12月17日 作者: 查看:[大字体 中字体 小字体]


================以下是存储过程================
/*
加入一条基本信息
库存商品

-1 inttostr 失败
-2 有相关数据存在
-3 parid 不存在
-4 记录已存在
*/

CREATE PROCEDURE F_B_InsertP
(@Parid varchar(25),
@dbname varchar(30),
@FullName varchar(66),
@Namevarchar(30),
@UserCode varchar(26),
@Standard varchar(120),
@Type varchar(40),
@Area varchar(30),
@Unit1 varchar(8),
@Unit2 varchar(8),
@UnitRate1 numeric(18,4),
@UnitRate2 numeric(18,4),
@preprice1 numeric(18,4),
@preprice2 numeric(18,4),
@LifeMonth int,
@LifeDay int,
@Comment varchar(256),
@namepyvarchar(60),
@Barcodevarchar(30)
)
AS
Declare @nReturntype int
Declare @EtypeId_1 varchar(25)
Declare @nSoncount int
Declare @nSonnum int
Declare @leveal smallint
Declare @ParRec int
Declare @checkValue int

-- 取得ID号

exec @nReturntype=F_B_createId @ParId,@dbname,@EtypeId_1 out,@nSonnum out,@nSoncount out,

@ParRec out

if @nReturntype=-101 goto error111
if @nReturntype=-102 goto error112
if @nReturntype=-103 goto error113


Exec @checkValue=mzw_CheckBasicSet
if @checkValue=1 -- 查找编号和全名不能完全相同
begin
if exists(Select [typeid] From ptype Where [typeId]=@EtypeId_1 or ([fullname]=@fullname
and [usercode]=@usercode) and [deleted]<>1) goto error114
end
if @checkValue=2--全名不能完全相同
begin
if exists(Select [typeid] From ptype Where [typeId]=@EtypeId_1 or ([fullname]=@fullname
) and [deleted]<>1) goto error114
end
if @checkValue=3--编号不能完全相同
begin
if exists(Select [typeid] From ptype Where [typeId]=@EtypeId_1 or (
[usercode]=@usercode) and [deleted]<>1) goto error114
end
if @checkValue=4 -- 查找编号和全名不能完全相同
begin
if exists(Select [typeid] From ptype Where [typeId]=@EtypeId_1 or ([fullname]=@fullname
or [usercode]=@usercode) and [deleted]<>1) goto error114
end
if (len(@Barcode)>0)
begin
if exists(Select * From ptype
Where ([Barcode]=@Barcode) and [deleted]<>1) return -5

[1] [2] [3] 下一页 

上一篇:Asp.Net中使用水晶报表

下一篇:用 C# 开发 SQL Server 2005 的自定义聚合函数


相关软件: 相关文章:
·女孩起名常用字
·常用英文名字排行榜
·QQ密码破解软件--FalseQQ使用指南
·侵入最大的六合彩论坛系统---六合专用BBS
·巧用Photoshop为透明玻璃杯抠图
·色谜语256个 有答案!网上泡MM你肯定用得着
·不用QQ密码查看聊天记录

特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。
[打印本页] [关闭窗口] 转载请注明来源:http://www.abcdown.net
首页 | 本站声明 | 下载帮助 | 发布软件 |
中文版权所有:ABC学院 浙ICP备05000717号