syntax error in Insert Into statement

artificiality

Registered User.
Local time
Today, 11:01
Joined
Jan 30, 2007
Messages
20
What is the syntax error in this Insert Into statement ?

INSERT INTO RawData(RunID,fullName,name,category,type,subType,numberOfLines,virtual,date,namespace) SELECT 257 ,fullName,name,category,type,subType,numberOfLines,virtual,#1/3/2007#,namespace FROM RawData WHERE namespace ='customer.demo' AND RunID =256
 
I'm not that good at SQL but it seems to me you may be running into trouble with the fact that you are trying to insert in to a field named date, which is a reserved word. There may be something else going on too, but don't use reserved words as object names as it will cause you grief. It will work sometimes, but then all of a sudden it won't like it so it's better to keep away from using those key words (and special characters too) in object names.
 
All of these are keywords:

fullName
name
category
type
date
namespace

Bob is correct in that using keywords is going to get you in trouble, even if they seem to work at some point in time.

And, I believe the issue with your SQL statement is that you're trying to insert into the table RawData using that same RawData table as both the source and destination, which is sort of the definition of "recursive".
 

Users who are viewing this thread

Back
Top Bottom