troubleshooting Question

dropping a table if it exists in sql server 2005

Avatar of blossompark
blossomparkFlag for Ireland asked on
Microsoft SQL Server 2005SQL
6 Comments5 Solutions270 ViewsLast Modified:
Hi,
    The following code  creates a table called New_Table in the database
and loads the result of the UNION into the new table.

SELECT  X.* INTO New_Table FROM

((SELECT  
 Netbios_name as Machine_Name,
Last_Login as User_Name
FROM  Table_A)

union

(select
CI_Name,
Used_by
from
Table_2)) as X


I now need to drop this table if it exists ,
my question is what syntax do i need to precede this with in order to drop the table New_Table?

Thanks
ASKER CERTIFIED SOLUTION
tolgaong

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 5 Answers and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 5 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros