15 pts.
Q:
Msg 102, level 15, State 1, Line 14
Hi, I'm ttrying to create my db tables in a stored procedure and I keep getting the error that the syntax is incorrect around the 'ON' on the line "SET ANSI_NULLS ON". Could you please help me? I can't see what's wrong. Here's my code: 

CREATE PROCEDURE InsertDBTables 

AS 

BEGIN 

SET NOCOUNT ON; 

SET ANSI_NULLS ON 

GO 

SET QUOTED_IDENTIFIER ON 

GO 

SET ANSI_PADDING ON 

GO 

 /** Table ETUDIANT **/ 

/****** Object: Table [dbo].[ETUDIANT] Script Date: 11/19/2009 09:20:50 ******/ 

CREATE TABLE [dbo].[ETUDIANT](

[MATRICULE] [char](7) NOT NULL,

[MOT_PASSE_ETU] [varchar](50) NOT NULL,

[NOM_ETU] [varchar](50) NOT NULL,

[PRENOM_ETU] [varchar](50) NOT NULL,

[SEXE_ETU] [Bit] NOT NULL,

[TEL_ETU] [varchar](20) NULL,

[EMAIL_ETU] [varchar](75) NOT NULL,

[COHORTE] [numeric](4, 0) NOT NULL,

[TYPE_STAGE_INSCR] [numeric](1, 0) NOT NULL,

[STATUT_ETU] [numeric](1, 0) NOT NULL DEFAULT ((1)),

[NUM_STAGE] [numeric](6, 0) NULL,

 CONSTRAINT [PK_MATRICULE] PRIMARY KEY CLUSTERED 

(

[MATRICULE] ASC

)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]

) ON [PRIMARY]


GO

SET ANSI_PADDING OFF

END 

GO


Software/Hardware used:
SQL server 2005
ASKED: Nov 19 2009  6:54 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
32725 pts.
A:
 RATE THIS ANSWER
+1
Click to Vote:
  •   1
  •  0
  • Bookmark and Share
Remove all the 'GO's that are inside the stored procedure body, and it should work.
Last Answered: Nov 19 2009  7:09 PM GMT by Carlosdl   32725 pts.
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

MasterK   15 pts.  |   Nov 19 2009  7:37PM GMT

Thank you sooooo very much! It was so simple, yet I never even thought about that! Everything works great now.
Thanks again