存储过程调用自定义函数
来源:互联网 发布:大数据可视化软件 编辑:程序博客网 时间:2024/04/30 06:06
--存储过程
use WX
go
-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
CREATE PROCEDURE AddUser
-- Add the parameters for the stored procedure here
( @loginName nchar(20),
@passWord nchar(128),
@empId int=null )
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
declare @id int
select @id = dbo.GetNewID()
-- Insert statements for procedure here
insert table_user (id, loginName, password, empid) values (@id, @loginName, @password, @empId)
END
GO
--自定义函数
use WX
go
-- ================================================
-- Template generated from Template Explorer using:
-- Create Scalar Function (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
--
-- This block of comments will not be included in
-- the definition of the function.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date, ,>
-- Description: <Description, ,>
-- =============================================
CREATE FUNCTION GetNewID
(
-- Add the parameters for the function here
)
RETURNS int
AS
BEGIN
declare @newId int;
select @newId = MAX(id)+1 from dbo.Table_User
return @newId
END
GO
- 存储过程调用自定义函数
- 存储过程调用函数
- [示例]存储过程循环与用户自定义函数递归调用
- [示例]存储过程循环与用户自定义函数递归调用
- Oracle 存储过程中调用自定义的函数问题?
- 存储过程调用自定义函数实现循环更新
- 存储过程或自定义函数调用存储过程的变通实现方法
- 存储过程或自定义函数调用存储过程的变通实现方法
- 自定义存储过程和函数
- oracle自定义函数、存储过程
- 自定义存储过程和函数
- 函数传空参 调用存储过程
- EF调用存储过程、函数
- oracle函数调用存储过程
- JDBC:调用函数&存储过程
- 调用存储过程和函数
- EF调用存储过程、函数
- MySQL存储过程和自定义函数、Navicat、创建存储过程和函数、调用存储过程和函数、三种方式、In和Out类型参数、
- Spring Portlet MVC
- 由于出现错误 c00ce56e 而导致此项操作无法完成。
- ObjectARX注册命令
- 查找某段话所在的文件
- string类的构造函数,拷贝构造函数,析构函数和赋值函数
- 存储过程调用自定义函数
- VS2005--设置Release模式下调试
- 金山词霸”屏幕取词技术揭密(讨论稿)
- php文件上传类型(MIME)对照表
- set path
- linux汇编必读
- as3:Math.random()
- 硬盘数据恢复
- oj提交结果整理