Поделиться через


DROP VIEW (U-SQL)

Summary

A view can be dropped with the DROP VIEW statement. The statement drops the specified view but leaves the underlying data sources untouched.

Warning

This operation cannot be undone!

Syntax

Drop_View_Statement :=                                                                                   
    'DROP' 'VIEW' ['IF' 'EXISTS'] Identifier.

Remarks

  • Identifier
    Specifies the name of the view to be defined. If a view of the given name does not exist, or the user has no permissions to drop the view, an error is raised.

  • IF EXISTS
    If the optional IF EXISTS is specified, then the statement drops the view if it already exists, or succeeds without changes if the view does not exist or the user has no permission to at least enumerate all existing views.

Examples

  • The example can be executed in Visual Studio with the Azure Data Lake Tools plug-in.
  • The script can be executed locally. An Azure subscription and Azure Data Lake Analytics account is not needed when executed locally.

The following statement deletes the view SampleView in the current database context and schema context if it exists and completes without changes if the view does not exist:

DROP VIEW IF EXISTS TestReferenceDB.dbo.SampleView;  

See Also