Skip to content Skip to sidebar Skip to footer

Sql Delete Statement Syntax

Trying to execute a delete query and getting the following error Syntax error (missing operator) in query expression 'cname VALUES @cname'. code Dim conn As OleDbConnection = Ne

Solution 1:

You need an operator

DELETEFROM products WHERE cname =@cname

Solution 2:

The way you wrote your delete statement is not correct.

You should write it like this:

DimcmdText="DELETE FROM products WHERE cname = @cname"

Solution 3:

And to delete all record from a table with a specific ID, you just have to;

deleteMore:
DELETE TOP(100) TableName WHERE toDelete='17'
IF @@ROWCOUNT!=0
    goto deleteMore:

This will delete the first 100 records, and repeatedly until all records with 17 are gone.

Post a Comment for "Sql Delete Statement Syntax"