question

goza1515 avatar image
goza1515 asked

i get an SyntaxError with my SP Insert Statment

I keep getting an error when i try to create my SP any one can provide me with a push that would be great. Msg 102, Level 15, State 1, Procedure usp_Bernard_AddProspectPurge, Line 42 Incorrect syntax near '@ClientKey'. CREATE PROCEDURE [dbo].[usp_AddProspectPurge] @DateCriteria varchar(500), @DateCriteriaOld varchar(500), @ClientKey varchar (50) as BEGIN SET NOCOUNT ON; /********************************************************************************************************************** * Creator: * Date: * Title: * Description: * Examples: * Modifications: Developer Name Date Description ------------------ ---------- ----------------------------------------------------------- * **********************************************************************************************************************/ -------------------------- --- Body of Procedure -- -------------------------- insert into dbo.purgeSetup select ClientID ,DatabaseInstance ,ClientKey ,@DateCriteria ,1 ,null, @DateCriteriaOld From ClientSettings where ClientKey = @ClientKey
insertsyntaxsp
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
SteveHood79 avatar image
SteveHood79 answered
You have a BEGIN but no END. Just throw END on as the last line.
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

goza1515 avatar image goza1515 commented ·
Thank you!
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.