Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I need to programatically determine the size, type and name of all of the fields in all of the tables of a large Sybase database.

 

I know how to do this in MySQL and MS SQL, but can't figure it our in Sybase. Their documentation seems to say 'sp_help', however it doesn't work programatically

 

Anyone done this before? Sorry for all of the Sybase questions - this product is pretty poorly documented and I am new to it

Read the Fovean Chronicles

Because you just can't spend your whole day programming!

Posted

Never mind. For the next person who needs it:

 

Fill a datatable with your list of tables:

 

Select ID, NAME from dbo.SysObjects WHERE Type='U'

 

Then for each row in the datatable:

 

Select * from dbo.syscolumns WHERE ID= <the id from the datatable containing the Name and ID's>

 

Now you have all of the information for each field in each table

Read the Fovean Chronicles

Because you just can't spend your whole day programming!

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...