Incorrect syntax near '*'

  • Thread starter Thread starter Mario Krsnic
  • Start date Start date
M

Mario Krsnic

Hallo zusammen,
I have an app. with SQL-Server. The same page worked fine with Access-DB.
Now I have a problem with this command:

Dim strSQL As String

Dim myConnection As New
SqlConnection("server=mssql07.1und1.de;uid=dbo88888888;pwd=8888888;database=db88888888")

myConnection.Open()

strSQL = "delete * from tbl1 where id =" & n

Dim myCommand As New SqlCommand(strSQL, myConnection)

myCommand.ExecuteNonQuery()

myConnection.Close()

if I try to perform the command I get this message:

Incorrect syntax near '*'

What is the right syntax?
Thank you!
Mario
 
Howdy,

SQL server does not understand * in delete statement.
strSQL = "delete from tbl1 where id =" & n
 
Back
Top