How To Drop Existing Views from a Database in MS SQL Server?
Submitted by: AdministratorIf you don't need a specific view any more, you can use the DROP VIEW statement to delete it from the database. The following tutorial exercise shows you how to delete the view, ggl_links_view:
USE GlobalGuideLineDatabase;
GO
SELECT * FROM sys.views;
GO
name object_id schema_id type type_desc
--------------- ----------- ---------- ---- ----------
ggl_links_view 1189579276 1 V VIEW
ggl_links_top 1205579333 1 V VIEW
(2 row(s) affected)
DROP VIEW ggl_links_view;
GO
SELECT * FROM sys.views;
GO
<pre>name object_id schema_id type type_desc
--------------- ----------- ---------- ---- ----------
ggl_links_top 1205579333 1 V VIEW
(1 row(s) affected)</pre>
Submitted by: Administrator
USE GlobalGuideLineDatabase;
GO
SELECT * FROM sys.views;
GO
name object_id schema_id type type_desc
--------------- ----------- ---------- ---- ----------
ggl_links_view 1189579276 1 V VIEW
ggl_links_top 1205579333 1 V VIEW
(2 row(s) affected)
DROP VIEW ggl_links_view;
GO
SELECT * FROM sys.views;
GO
<pre>name object_id schema_id type type_desc
--------------- ----------- ---------- ---- ----------
ggl_links_top 1205579333 1 V VIEW
(1 row(s) affected)</pre>
Submitted by: Administrator
Read Online MS SQL Server Job Interview Questions And Answers
Top MS SQL Server Questions
☺ | What Happens If NULL Values Are Involved in Bitwise Operations? |
☺ | PHP MSSQL - How To Display a Past Time in Days, Hours and Minutes? |
☺ | What Happens If Strings Are Casted into Wrong Code Pages in MS SQL Server? |
☺ | What Is a Subquery in a SELECT Query Statement in MS SQL Server? |
☺ | How To Use Subqueries with the IN Operators in MS SQL Server? |
Top Databases Programming Categories
☺ | RDBMS Interview Questions. |
☺ | SQL Interview Questions. |
☺ | SSRS Interview Questions. |
☺ | Sybase Interview Questions. |
☺ | Database Administrator (DBA) Interview Questions. |