Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    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

    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
    Last edited by desireemm; 08-02-04 at 13:37.

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    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."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •