Check Whether a SQL Object Exists
Product:
SQL Server
To prevent errors when creating a new objet in SQL, you can query the Information Schema Views to find out whether it already exists, and then either not create the object or delete it before recreating it.