【SQL开源代码栏目提醒】:文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。网学会员整理了SQL开源代码-EditProduct.sql的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
-- ================================================
-- 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 [dbo].[EditProduct]
-- Add the parameters for the stored procedure here
@no int,
@name text,
@place text,
@price smallmoney,
@type nchar(5),
@oper int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
if @oper = 1
Insert into Product(编号,名称,产地,价格,类型编号) values(@no,@name,@place,@price,@type)
if @oper = 2
Update Product set 产地=@place,价格=@price,类型编号=@type where 编号=@no
if @oper = 3
Delete from Product where 编号=@no
return
END
GO