
August 4th, 2004, 11:22 AM
|
|
Contributing User
|
|
Join Date: Jul 2004
Posts: 31
Time spent in forums: 1 h 38 m 35 sec
Reputation Power: 5
|
|
|
Append stored procedure
I need to make this into an APPEND stored procedure, basically one that inserts data from one table to the other once the record becomes inactive. This is what I have so far I need to the data inserted from another table called the EmployeeGamingLicense (active table). I need for data to get inserted as soon as the Status field shows the record as TERMINATED. Can anyone help pls??
Code:
CREATE PROCEDURE [insert_TERMINATION_TestSp]
(@TM_#_1 [int],
@FirstName_2 [nvarchar](50),
@LastName_3 [nvarchar](50),
@SocialSecurityNumber_4 [int],
@DateHired_5 [datetime],
@Status_6 [nvarchar](50),
@Title_7 [nvarchar](50),
@DepartmentName_8 [nvarchar](50))
AS INSERT INTO [GamingCommissiondb].[dbo].[TERMINATION]
( [TM #],
[FirstName],
[LastName],
[SocialSecurityNumber],
[DateHired],
[Status],
[Title],
[DepartmentName])
VALUES
( @TM_#_1,
@FirstName_2,
@LastName_3,
@SocialSecurityNumber_4,
@DateHired_5,
@Status_6,
@Title_7,
@DepartmentName_8)
GO
|