Solved

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

Posted on 2016-10-17
4
41 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 12

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 12

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

831 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