
GO
/****** Object:  StoredProcedure [dbo].[ht_RegCustomer]    Script Date: 11/29/2011 20:07:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

create PROC [dbo].[ht_RegCustomer](@name varchar(100),@sex int,@telephone varchar(20),@mobile varchar(20),@email varchar(100),@corpName varchar(100),@department varchar(100),@duties varchar(100),@address varchar(100),@postcode varchar(100),@fax varchar(50),@isaddIT int)
AS
BEGIN
	DECLARE @customerid UNIQUEIDENTIFIER;
	SET @customerid = NEWID();
	
	INSERT INTO Ht_customerBase ([CreatedBy],[CreatedOn],[DeletionStateCode],[Ht_customerId],[ModifiedBy],[ModifiedOn],[OverriddenCreatedOn],[OwningBusinessUnit],[statecode] ,[statuscode],[OwningUser])
	VALUES('FD1A2843-0601-E111-82B9-0015175F01E0',GETUTCDATE(),0,@customerid,'FD1A2843-0601-E111-82B9-0015175F01E0',GETUTCDATE(),GETUTCDATE(),'9B826549-0601-E111-82B9-0015175F01E0',0,1,'FD1A2843-0601-E111-82B9-0015175F01E0')
	
	INSERT INTO Ht_customerExtensionBase(Ht_customerId,Ht_name,Ht_sex,Ht_telephone,Ht_mobile,Ht_email,Ht_corpName,Ht_department,Ht_duties,Ht_address,Ht_postcode,Ht_fax,Ht_isaddIT)
    VALUES(@customerid,@name,@sex,@telephone,@mobile,@email,@corpName,@department,@duties,@address,@postcode,@fax,@isaddIT)
END
