Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Check table existence and delete entire records using Server 2005

$
0
0

I am trying to delete the entire record of table after confirmation of Table existence using SQL Server 2005 SP3,

query is as follows - 

USE smsDB;
GO
IF (OBJECT_ID('organTable', 'U') IS NOT NULL) 
  BEGIN 
    PRINT 'Table Exists' 
	DELETE FROM organTable;
  END 
ELSE 
  BEGIN 
    PRINT 'Table not Exists' 
  END
GO

please help to delete the entire table records...


Pl. Mark/Proposed as Answer if found your solution Vote as Helpful if related to your topic. Always Motivate others by performing this Action.


Viewing all articles
Browse latest Browse all 23857


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>