How can I drop a table if it exists in SQL Server 2000?

Posted by Keng on Stack Overflow See other posts from Stack Overflow or by Keng
Published on 2008-10-30T18:11:06Z Indexed on 2010/05/30 14:22 UTC
Read the original article Hit count: 239

Filed under:
|

I have a DTS package that drops a table then creates it and populates it but sometimes something happens and the package fails after the drop table. If it's rerun it fails cuz the table hasn't been created yet.

Is there something like "if exists" for SQLServer 2000 like in MySQL?

thanks.

Edit Thanks everyone! I went with TrickyNixon because his was quick and easier to initiate. But, I would like everyone to eval that statement and make sure it is best-practices because if it is, I'm TOTALLY going to dump that into EVERY drop/create DTS package I see!!! Nice work TrickyNixon and everyone who threw in on this.

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server