sql server 存储过程例子
时间:2011-05-13 来源:keep change
之前对存储过程不是很熟悉,现在写出来例子,以后用。会持续更新的。
例子1:插入存储过程
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
-- =============================================
-- Author: <Author,,SC_Zhang>
-- Create date: <Create Date,2011-05-03,>
-- Description: <Description,往tbl_exam_materials插入一条记录>
-- =============================================
CREATE PROCEDURE [dbo].[tbl_exam_materials_insert]
-- Add the parameters for the stored procedure here
@exam_group_id int,
@exam_type_name nvarchar(50) = NULL,
@exam_name nvarchar(200) = NULL,
@exam_code nvarchar(20),
@exam_quota int,
@exam_account bigint,
@exam_fee int,
@exam_prereq nvarchar(100)=NULL,
@exam_upload_material_path varchar(200)=NULL,
@exam_app_form_path varchar(200)=NULL,
@exam_remark nvarchar(200)=NULL,
@create_date datetime=NULL,
@created_by nvarchar(50)=NULL,
@modify_date datetime=NULL,
@modified_by nvarchar(50)=NULL
AS
BEGIN
-- Insert statements for procedure here
INSERT INTO [datebase_name].[dbo].[tbl_exam_materials]
(exam_group_id,exam_type_name,exam_name,exam_code,exam_quota,exam_account,exam_fee,exam_prereq,exam_upload_material_path,exam_app_form_path,exam_remark,create_date,created_by,modify_date,modified_by)
VALUES
(@exam_group_id,
@exam_type_name,
@exam_name,
@exam_code,
@exam_quota,
@exam_account,
@exam_fee,
@exam_prereq,
@exam_upload_material_path,
@exam_app_form_path,
@exam_remark,
@create_date,
@created_by,
@modify_date,
@modified_by)
END
相关阅读 更多 +
排行榜 更多 +