[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 445
  • Last Modified:

Syntax error in delete statement

Currently upgrading from Access to MS SQL in classic ASP applications. I have one app that deletes the contents of a table before repopulating the table. It worked fine in Access but is erroring out with the MS SQL Database.

Error message:
Microsoft OLE DB Provider for SQL Server error '80040e14'

Incorrect syntax near '*'.

/sql_test/index.asp, line 14


Code:
theSQL = "delete * from u_id"
      response.Write(theSQL)
      Conn.execute(theSQL)
      set theSQL = Nothing

Any ideas?
Thanks
0
panhead802
Asked:
panhead802
1 Solution
 
Chris MangusDatabase AdministratorCommented:
Just say Delete From u_id, the star is unnecessary.
0
 
Göran AnderssonCommented:
Access is accepting both the forms "delete from" and "delete * from", but SQL Server only accepts the form "delete from".

The form "delete * from" is quite illogical anyway. There is no reason to specify and fields in a delete query, as you can only delete entire records, you can't delete only some fields from a record.
0
 
panhead802Author Commented:
cmangus, thanks for the quick reply.
greenghost thank you for the additional info.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now