Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2016-10-17
4
Medium Priority
?
66 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:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 53

Accepted Solution

by:
Ryan Chong earned 2000 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 14

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 14

Expert Comment

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

Author Closing Comment

by:Murray Brown
ID: 41847687
Thanks very much
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

721 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