View Single Post
 
Old September 15th, 2004, 11:45 AM
desireemm desireemm is offline
Authorized User
 
Join Date: Aug 2004
Location: LAKESIDE, California, USA.
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default Stored Procedure

I keep getting incorrect syntax with this statement can anyone tell me whats wrong says incorrect syntax must declare the variable

Code:
CREATE PROCEDURE [insert_Corovan_Table_1]
@pdBegin  DATETIME =  TerminationDate (BETWEEN CONVERT(DATETIME, '2003-01-01 00:00:00', 102) AND CONVERT(DATETIME, '2003-12-31 00:00:00', 102))
@pdEnd    DATETIME=   NULL
AS
IF @pdBegin IS NULL
   SET @pdBegin = DateAdd(year, -2, GetDate())
IF @pdEnd IS NULL
   SET @pdEnd = DateAdd(year, 1,@pdBegin)

AS INSERT INTO [GamingCommissiondb].[dbo].[Corovan_Table] 
     ( [TM #],
     [FirstName],
     [LastName],
     [SS #],
     [TerminationDate],
     [Voluntary or Involuntary],
     [Notes]) 
SELECT   ([TM#],     
     [FirstName],    
     [LastName],     
     [SS #],     
     [TerminationDate],     
     [Voluntary_or_Involuntary],
     [Notes],)
FROM TERMINATION 
GO