SqlConnection.getSchema("Tables"). it returns me a list of all tables while getSchema("Views") returns me the views in the form of DataTable.
But can we have a way to get them together in the same DataTable as a return result? because I want to read the rows by DataTable.CreateDataReader() later.
select
Namefromsysobjectswhere typein('v','u')and status>-1Will return a list of all the user tables and views.
|||In SQL Server 2005, you should use system view for the same result.
select * from sys.objects where type in ('v','u')
No comments:
Post a Comment