Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Express Edition and Compact Edition (2005)
 Unable To Delete In SQLCE 2005

Author  Topic 

iworkonline
Starting Member

3 Posts

Posted - 2010-03-06 : 09:39:51
I am using VB.Net and writing the following statement
sSQL = "Delete * from detail where order_no = '" & OrderNumber & "' and Item_no = '" & sDSItemNo & "'"
cmd.CommandText = sSQL
cmd.ExecuteNonQuery()

and I am getting the following error

There was an error parsing the query. [ Token line number = 1,Token line offset = 8,Token in error = * ]

Then I tried to run the SQL statement from withing the SQL MGMT Studio
as follows

Delete * from detail where order_no = '0104573' and Item_no = 'BT REPL 1%'

I am getting the same error, which is:
ajor Error 0x80040E14, Minor Error 25501
> Delete * from detail where order_no = '0104524' and item_no = 'BT REPL 2%'
There was an error parsing the query. [ Token line number = 1,Token line offset = 8,Token in error = * ]

Please help.
Thanks.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-03-07 : 02:39:32
remove the '*'
sSQL = "Delete from detail where order_no = '" & OrderNumber & "' and Item_no = '" & sDSItemNo & "'"




KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

iworkonline
Starting Member

3 Posts

Posted - 2010-03-07 : 11:16:24
quote:
Originally posted by khtan

remove the '*'
sSQL = "Delete from detail where order_no = '" & OrderNumber & "' and Item_no = '" & sDSItemNo & "'"




KH
[spoiler]Time is always against us[/spoiler]





Thanks for your time, I realized what I was doing wrong.
Go to Top of Page
   

- Advertisement -