• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 77
  • Last Modified:

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

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
Murray Brown
Asked:
Murray Brown
  • 2
1 Solution
 
Ryan ChongCommented:
>> 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
 
Nakul VachhrajaniTechnical Architect, Capgemini IndiaCommented:
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
 
Nakul VachhrajaniTechnical Architect, Capgemini IndiaCommented:
Sorry, Ryan - didn't mean to overlap with your comment.
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks very much
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now