Incorrect syntax near ','.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PRODIKEY
    New Member
    • Sep 2010
    • 2

    #1

    Incorrect syntax near ','.

    I wanna to try BULK Insert from NEW_TUTOR to TUTOR and below are my sql statement :

    Code:
    CREATE Table TUTOR(
    TutorName	varChar(100)	NOT NULL,
    TutorContact	Numeric(8)	NOT NULL,
    TutorAddress	Text		NULL,
    Qualification	varChar(10)	NULL DEFAULT 'Degree',
    CONSTRAINT	TutorNamePK	PRIMARY KEY(TutorName)
    );
    
    CREATE Table NEW_TUTOR(
    TutorName	varChar(100)	NOT NULL,
    TutorContact	Numeric(8)	NOT NULL,
    Qualification	varChar(10)	NULL DEFAULT 'Degree',
    CONSTRAINT  NewTutorNamePK  PRIMARY KEY(TutorName)
    );
    Code:
    Insert into NEW_TUTOR(TutorName,TutorContact,Qualification)
    	values('John',56433227,'‘A’Level);
    Insert into NEW_TUTOR(TutorName,TutorContact,Qualification)
    	values('Min Shen',65768765,'‘O’Level');
    Insert into NEW_TUTOR(TutorName,TutorContact,Qualification)
    	values('Micheal',65678989,'‘A’Level');
    
    INSERT INTO TUTOR(TutorName,TutorContact,Qualification) 
    SELECT (TutorName,TutorContact,Qualification)
    FROM NEW_TUTOR;

    When I execute the BULK Insert, the SQL SERVER prompted me
    Msg 102, Level 15, State 1, Line 2
    Incorrect syntax near ','.


    Any suggestion how to over come this.
    Last edited by Niheel; Sep 29 '10, 06:33 PM.
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Check out the value's you're inserting to Qualification column. What's with '‘ ??

    ~~ CK

    Comment

    • PRODIKEY
      New Member
      • Sep 2010
      • 2

      #3
      Thanks I found my mistake..

      INSERT INTO TUTOR(TutorName ,TutorContact,Q ualification)
      SELECT TutorName,Tutor Contact,Qualifi cation
      FROM NEW_TUTOR;

      *Remove the () under select statement

      Comment

      Working...