How To See Existing Views in MS SQL Server?
Submitted by: AdministratorIf you want to know how many views you have created in a database, you use the system view called sys.views to get a list of views defined in the current database. The tutorial exercise shows you how many views in database GlobalGuideLineDatabase:
USE GlobalGuideLineDatabase;
GO
CREATE VIEW ggl_links_view AS
SELECT * FROM ggl_links;
GO
SELECT * FROM sys.views;
GO
<pre>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)</pre>
Submitted by: Administrator
USE GlobalGuideLineDatabase;
GO
CREATE VIEW ggl_links_view AS
SELECT * FROM ggl_links;
GO
SELECT * FROM sys.views;
GO
<pre>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)</pre>
Submitted by: Administrator
Read Online MS SQL Server Job Interview Questions And Answers
Top MS SQL Server Questions
☺ | How To Sort Query Output in Descending Order in MS SQL Server? |
☺ | What Are Binary String Data Types in MS SQL Server? |
☺ | What Happens If Strings Are Casted into Wrong Code Pages in MS SQL Server? |
☺ | How to Create a View using Data from Another View? |
☺ | Can Another User Execute Your Local Temporary Stored Procedures? |
Top Databases Programming Categories
☺ | RDBMS Interview Questions. |
☺ | SQL Interview Questions. |
☺ | SSRS Interview Questions. |
☺ | Sybase Interview Questions. |
☺ | Database Administrator (DBA) Interview Questions. |