Msg 102, level 15, State 1, Line 14

15 pts.
Tags:
CREATE TABLE statement
SQL
Stored Procedures
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

Remove all the ‘GO’s that are inside the stored procedure body, and it should work.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • MasterK
    Thank you sooooo very much! It was so simple, yet I never even thought about that! Everything works great now. Thanks again
    15 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following