I want to delete selected column values only... I have this statement:

strsql = "delete book1, author1, from book_Load where Book_ID_no = '" & bkIDnum.Text & "'"
With sqlcmd
            .CommandText = strsql
            .Connection = sqlconn
            .ExecuteNonQuery()
        End With

the error is "Incorrect syntax near ','."
please help me with this... thanks

Recommended Answers

All 3 Replies

Remove the comma after author1. It should read:

strsql = "delete book1, author1 from book_Load where Book_ID_no = '" & bkIDnum.Text & "'"

I've already did that but the error is still the same

you can not delete single column value , you have to delete full record , if you want to delete value of single column then try to use update , just update the value with null .

Regards

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.