TSQL delete view if it already exists


/ Published in: SQL
Save to your folder(s)



Copy this code and paste it in your HTML
  1. IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME = 'v_MyView') BEGIN
  2. DROP VIEW dbo.v_MyView
  3. PRINT 'Dropped dbo.v_MyView'
  4. END

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.