Thread: stored procedure
08-02-04, 12:29 #1Registered User
- Join Date
- Feb 2004
- Alpine Califormia
Unanswered: stored procedure
does anyone see anything wrong with my stored procedure, its suppose to update the terminations table through an insert. I need it to pull the data from another table the EmployeeGamingLicense_tbl and insert it into the Terminations table
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
Last edited by desireemm; 08-02-04 at 12:37.
08-02-04, 12:32 #2Registered User
- Join Date
- Jul 2003
- San Antonio, TX
Looks good. I'd add some error checking at the end though (if @@error != 0...)"The data in a record depends on the Key to the record, the Whole Key, and
nothing but the Key, so help me Codd."