Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Can anyone please tell me how to retrieve all tables in an SQL server database. I know that it can be done with an OleDB connection using the GetOleDbSchemaTable method. But the GetSchemaTable method for the SqlConnection only returns column schema. Any help is greatly appreciated. Thanks!

 

Cheers!~ :D

Posted

I found the answer! You CAN'T get the table schema from SQL Server using the GetSchemaTable function. In order to list all of the FIELDS in a table, you use the GetSchemaTable function. In order to list all tables in a given database, I found that selecting the NAME from sysobjects table where xtype = 'n' would retrieve all tables in the desired database. the xtype column is used to identify databases. This may be unique to each useage, but it is a starting point!

 

Cheers!~

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...