I am trying to delete particular tables routinely from the sys.tables in vb.net. here is code, but it does not work.
Try
Dim MyCommand As New Odbc.OdbcCommand("", MyConnection)
MyCommand.CommandText = "drop from sys.tables where tabname like '% " & span & "%'"
Dim result As Integer = MyCommand.ExecuteNonQuery
MyCommand.Dispose()
Catch ex As Exception
End Try
Please never try to change sysviews data. They are for your information. You change that data by executing DDL commands.
In your case you need one
DROP TABLE tablenameper table.You can use sys.tables to get a list of tables to execute a
DROPagainst, but theDROPs must be separate commands.Also, it’s good to accustom yourself to the correct Dispose pattern: