Many time we need to check if object exists or not in SQL server when we create new objcet(i.e. DB,Table,View,SP,Functions etc). There are certain situation when if particular object exist then drop/modify else Create. Because we need to run script again and again on same DB to avoid any existance error we use check if exists object. For such cases here i am writing Check if exist query for DB objects..... ----Check If Database Exists---- IF db_id('<DB_Name>') IS NOT NULL Print 'Database Exists' ELSE Print 'Database Does Not Exists' ----Check If Table Exists---- IF OBJECT_ID ('<Table_Name>','U') IS NOT NULL Print 'Table Exists' ELSE Print 'Table Does Not Exists' ----Check If SP Exists---- IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id (N'<SP_Name>') AND OBJECTPROPERTY(id, N'IsProcedure') = 1) Print 'SP Exists' ELSE ...