ALTER PROCEDURE [dbo].[sp_AddRecord]
(
@SerialNumber varchar(50)= NULL,
@Company varchar(50)= NULL,
@Invoice varchar(50)= NULL,
@DateAdded datetime
)
AS
BEGIN
SET NOCOUNT ON;
DECLARE @RetID As int
--Get Id from comapny Table
SELECT @RetID = [ID] FROM [lxp_1z3etnasf_site_aplus_net].[dbo].[Company] WHERE [Name] = @Company
--Insert Login and link to Company table
INSERT INTO [lxp_1z3etnasf_site_aplus_net].[dbo].[Certifications]
([Serial Number]
,[Invoice Authorization]
,[DateAdded]
,[CompanyID])
VALUES
(@SerialNumber
,@Invoice
,@DateAdded
,@RetID)
SELECT @@identity AS newID
END
|