|
-
Sep 25th, 2003, 01:01 PM
#1
Thread Starter
Lively Member
How do you get a list of tables in a SQL Server DB?
I have an ASP.NET application in which I need to connect to a specific SQL Server database and then list all of the tables contained within that database.
How can I accomplish this?
-
Sep 25th, 2003, 02:11 PM
#2
Are you asking how to get the list of table names from sql server or how to show them on a web page (or both)
If its the former then some options
1) Every SQL Server database has system Views that you can use to get schema information. Just run a query on the view. Something like
Code:
Select TableName From Information_Schema.Tables
Where Table_Type = 'Base Table'
2) Use ADOX.
3) Access the sql server system tables directly.
-
Sep 25th, 2003, 02:13 PM
#3
Thread Starter
Lively Member
-
Sep 25th, 2003, 02:18 PM
#4
Frenzied Member
or
Code:
SELECT * FROM sysobjects WHERE xtype = 'U'
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
-
Sep 25th, 2003, 02:40 PM
#5
FROM sysobjects WHERE xtype = 'U'
Which is basically what the Information_Schema.Tables
View executes.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|