By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,333 Members | 1,070 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,333 IT Pros & Developers. It's quick & easy.

DROP TABLE does not execute

P: n/a
When I am debugging this code and I step through it, after I run through to the cn.Close() statement, the table TABLENAME should be dropped...but it is not. Is there some other command I must run to "finalize" the SQL statement I just executed? Thank you

Chris
Dim cn As New ADODB.Connection
cn.Open("Driver={SQL Server};Server=SQLSERVER;Database=BIGDB;Trusted Connection=yes")
cn.CommandTimeout = 600
cn.Execute("IF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_CATALOG = 'MYDB' AND TABLE_NAME = 'TABLENAME') DROP table MYDB..TABLENAME")
cn.Close()
Nov 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.