Sqlserver-dba.com

Subscribe

SQLServer-DBA.com Links

Subscribe to newsletter

Dba_db2_button

Powered by TypePad
Select all SQL Server Views

06 March,2013 by Jack Vamvas

Question: How can I list all all SQL Views in a SQL Server database?

Answer:  Use the sys.objects  system SQL View and the type column to choose just the Views.  Try not to use the sys.sysobjects sy as it’s a deprecated view , to be decommissioned at some point in the future

USE Database_name
GO
--Method 1 
select [name] from sys.objects where type = 'V'
order by [name]

--Method 2
select * from sys.views

--Method 3 
select * from information_schema.tables where table_type = 'view'



Read More

SQL Server Materialized Views

SQL Server – refresh all Views

 


Author: Jack Vamvas (http://www.sqlserver-dba.com)

******** *******

Enjoy this post? Enter your email address for updates on new posts:

Delivered by FeedBurner

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment


sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer