Solved

VB.net list SQL views in the order they were created

Posted on 2016-10-17
4
27 Views
Last Modified: 2016-10-17
Hi

Is it possible in VB.net  to generate a list of the views in a SQL database in the order that they were created?

If so what VB.net code would I use?

Thanks
0
Comment
Question by:murbro
  • 2
4 Comments
 
LVL 49

Accepted Solution

by:
Ryan Chong earned 500 total points
ID: 41847653
>> in the order that they were created
yes, you can, you can try customize something like this:
SELECT TOP (100) PERCENT name, object_id, principal_id, schema_id, parent_object_id, type, type_desc, create_date, modify_date, is_ms_shipped, is_published, is_schema_published
FROM sys.objects
WHERE type = 'V'
ORDER BY create_date ASC

Open in new window

You can load query above into a datatable and bind it to a GridView (or similar control) to display the data.
0
 
LVL 11

Expert Comment

by:Nakul Vachhrajani
ID: 41847655
It would be a simple T-SQL query that you can fire off against the SQL Server instance from your VB application.

SELECT *
FROM [sys].[objects] AS [so]
WHERE [so].[is_ms_shipped] = 0
  AND [so].[type] = 'V'
ORDER BY [so].[create_date] ASC;

Open in new window

0
 
LVL 11

Expert Comment

by:Nakul Vachhrajani
ID: 41847656
Sorry, Ryan - didn't mean to overlap with your comment.
0
 

Author Closing Comment

by:murbro
ID: 41847687
Thanks very much
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now