syntax issue?

  • Thread starter Thread starter GotDotNet?
  • Start date Start date
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.
 
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
 
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
 
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.
 
Back
Top