if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CustomerCustomerDemo_Insert]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
    drop procedure [dbo].[CustomerCustomerDemo_Insert]
GO
------------------------------------
-- 功能描述：增加一条记录 
-- 所属表格：CustomerCustomerDemo[ ]
-- 作者名称：
-- 创建日期：
-- 修改日期：
 /*
 -- 测试代码 --
 -- 参数设置 
DECLARE @CustomerID nchar -- 客户ID
    SET @CustomerID = 
DECLARE @CustomerTypeID nchar -- 客户类型ID
    SET @CustomerTypeID = 
 -- 调用存储过程 
 exec [CustomerCustomerDemo_Insert] @CustomerID,@CustomerTypeID
 */
------------------------------------
CREATE PROCEDURE [CustomerCustomerDemo_Insert] (
@CustomerID      nchar = NULL,   -- 客户ID
@CustomerTypeID  nchar = NULL    -- 客户类型ID

)
AS
INSERT INTO CustomerCustomerDemo(
		 
)VALUES( 
		
)
SELECT @ID = SCOPE_IDENTITY() -- 返回新加记录的唯一标识
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CustomerCustomerDemo_Edit]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[CustomerCustomerDemo_Edit]
GO
------------------------------------
-- 功能描述：修改一条记录 
-- 所属表格：CustomerCustomerDemo[]
-- 作者名称：
-- 创建日期：
-- 修改日期：
 /* -- 测试代码 --
 -- 参数设置 
DECLARE @CustomerID nchar -- 客户ID
    SET @CustomerID = 
DECLARE @CustomerTypeID nchar -- 客户类型ID
    SET @CustomerTypeID = 
 -- 调用存储过程 
 exec [CustomerCustomerDemo_Edit] @CustomerID,@CustomerTypeID 
 */
------------------------------------
CREATE PROCEDURE [CustomerCustomerDemo_Edit]
@CustomerID      nchar = NULL,   -- 客户ID
@CustomerTypeID  nchar = NULL    -- 客户类型ID

AS 
UPDATE CustomerCustomerDemo SET 
	
WHERE 
	 [CustomerID] = @CustomerID, [CustomerTypeID] = @CustomerTypeID
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CustomerCustomerDemo_Delete]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[CustomerCustomerDemo_Delete]
GO
------------------------------------
-- 功能描述：删除一条记录 
-- 作者名称：
-- 创建日期：
-- 修改日期：
 /*
 -- 测试代码 --
 -- 参数设置 
 -- 调用存储过程 
DECLARE @ID int
    set @ID=0
 exec [CustomerCustomerDemo_Delete] @ID
 */
------------------------------------
CREATE PROCEDURE [CustomerCustomerDemo_Delete]
	@CustomerID nchar --待删除的主键
AS 
   
	    DELETE FROM [CustomerCustomerDemo]	    WHERE CustomerID = @CustomerID 
     
     
GO   
     


