Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object
Message
General information
Forum:
Microsoft SQL Server
Category:
Database management
Title:
Re: Object
Miscellaneous
Thread ID:
00975053
Message ID:
00975311
Views:
14
>Hi All:
> How can I check if a table exist and if id does I want to drop that table?
>Thanks
>ZA

Check Books On Line (BOL) and search for SQL-DMO or SQLDMO. I'm assuming here that you've got the Enterprise Manager installed.

If not, and you're using VFP, then look at SQLTABLES() in the VFP help. This will return all the tables or all the non-system tables, depending on the parameters. From there, you can use SQLEXEC() (after, of course, establishing a handle via SQLSTRINGCONNECT() or SQLCONNECT()) to pass a DROP TABLE... string.

Finally, you could use the IF EXISTS...function TSQL to do this.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform