syntax issue?

G

GotDotNet?

I'm trying to insert data from one table to another on sql server via C#.
here is my syntax:

insert into tableA (CustOrderNumber, custName, custState, CustCity) SELECT
('" + System.GUID.NewGUID() + '", Name, State, City) from custSales


I'm getting this error message:
There was an error parsing the query. [Token line number =1, Token line
offset = 129, Token in error =, ]

any ideas what could be causing this ?

I need to generate the CustOrderNumber on this insertion process due to its
not created on the actual sale.
don't ask, its hasn't been fun working with this db.
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

GotDotNet? said:
I'm trying to insert data from one table to another on sql server via C#.
here is my syntax:

insert into tableA (CustOrderNumber, custName, custState, CustCity) SELECT
('" + System.GUID.NewGUID() + '", Name, State, City) from custSales


I'm getting this error message:
There was an error parsing the query. [Token line number =1, Token line
offset = 129, Token in error =, ]

any ideas what could be causing this ?

I need to generate the CustOrderNumber on this insertion process due to its
not created on the actual sale.
don't ask, its hasn't been fun working with this db.

Remove the parenthesis around the fields in the select statement:

insert into tableA (CustOrderNumber, custName, custState, CustCity)
SELECT '" + System.GUID.NewGUID() + '", Name, State, City from custSales
 
S

shashank kadge

I'm trying to insert data from one table to another on sql server via C#.
here is my syntax:

insert into tableA (CustOrderNumber, custName, custState, CustCity) SELECT
('" + System.GUID.NewGUID() + '", Name, State, City) from custSales

I'm getting this error message:
There was an error parsing the query. [Token line number =1, Token line
offset = 129, Token in error =, ]

any ideas what could be causing this ?

I need to generate the CustOrderNumber on this insertion process due to its
not created on the actual sale.
don't ask, its hasn't been fun working with this db.

Is the table custSales has GUID as column name??

-
shashank kadge
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

shashank said:
I'm trying to insert data from one table to another on sql server via C#.
here is my syntax:

insert into tableA (CustOrderNumber, custName, custState, CustCity) SELECT
('" + System.GUID.NewGUID() + '", Name, State, City) from custSales

I'm getting this error message:
There was an error parsing the query. [Token line number =1, Token line
offset = 129, Token in error =, ]

any ideas what could be causing this ?

I need to generate the CustOrderNumber on this insertion process due to its
not created on the actual sale.
don't ask, its hasn't been fun working with this db.

Is the table custSales has GUID as column name??

-
shashank kadge

Why do you ask? He's not attempting to read any such field from the table.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top