If you need further help some more context and knowing the exact goal could help. You try to create an app for this db or you want to manage remotely a db ?
I wish to show list of all tables created by the user in particular database as a tree view.
Don't want to show system table. Instead of touching database i wish to retrieve all tables from database and update by myself.
Do you mean you want to show all the table except system table?
If this is your requirement, I suggest you could try to use below query:
select name from sysobjects where type='U'
Result:
Best Regards,
Brando
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
You can use views or system tables to list the database content but AFAIK SQL Server doesn't care about who created a table. They are organized in schémas and it cares about permissions only.
Member
33 Points
59 Posts
To show entire database in asp.net webpage
Jan 12, 2018 07:56 AM|poornima82|LINK
Hi,
Is it possible to display entire database in asp.net webpages?
Thanks,
Best Regards,
Poornima
All-Star
48570 Points
18086 Posts
Re: To show entire database in asp.net webpage
Jan 12, 2018 08:36 AM|PatriceSc|LINK
Hi,
"display entire database" is quite vague. Most of those tables are used by ASP.NET Identity.
Assuming you need a list of all table names you could use for example the standardized Information_Schema.Tables view or SQL Server system tables. Try https://docs.microsoft.com/en-us/sql/relational-databases/system-information-schema-views/system-information-schema-views-transact-sql
If you need further help some more context and knowing the exact goal could help. You try to create an app for this db or you want to manage remotely a db ?
Member
33 Points
59 Posts
Re: To show entire database in asp.net webpage
Jan 12, 2018 09:31 AM|poornima82|LINK
Hi PatriceSc,
Thanks for your reply.
I wish to show list of all tables created by the user in particular database as a tree view.
Don't want to show system table. Instead of touching database i wish to retrieve all tables from database and update by myself.
Regards,
Poornima
Star
9831 Points
3120 Posts
Re: To show entire database in asp.net webpage
Jan 16, 2018 07:57 AM|Brando ZWZ|LINK
Hi poornima82,
Do you mean you want to show all the table except system table?
If this is your requirement, I suggest you could try to use below query:
Result:
Best Regards,
Brando
All-Star
48570 Points
18086 Posts
Re: To show entire database in asp.net webpage
Jan 16, 2018 08:25 AM|PatriceSc|LINK
You can use views or system tables to list the database content but AFAIK SQL Server doesn't care about who created a table. They are organized in schémas and it cares about permissions only.
Try perhaps https://technet.microsoft.com/en-us/library/ms175941(v=sql.105).aspx if your goal is really to track db schema changes...
Member
33 Points
59 Posts
Re: To show entire database in asp.net webpage
Jan 17, 2018 07:20 AM|poornima82|LINK
Hi Brando ZWZ,
Thanks for your reply.
I tried your query. It displayed all tables in the database.
But my need is to display only tables of "particular database" as a tree view and not all tables in the database.
I haven't used tree view control before.. something like tree view format i need to display..
Help me to carry out.
Regards,
Poornima
Contributor
6711 Points
2334 Posts
Re: To show entire database in asp.net webpage
Jan 17, 2018 07:45 AM|cnranasinghe|LINK
I think you have to use SMO. For jump start follow this. Hope you can adapt to ASP.NET.
Further reading, try this as well.