Solved

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

Posted on 2016-10-17
4
44 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 50

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 13

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 13

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

790 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