get table structure

  • Thread starter Thread starter Jaime Lucci
  • Start date Start date
J

Jaime Lucci

Hi everyone!

I need to get a table structure from a SQL Server. I mean the full design of
the table with all tis properties and its fileds properties too. For
example, an integer field, its max lenght, if it is an identity, etc. I
can´t get that.

Whit a select command I can have the table structure in my dataset, but I
can insert a new row and in this row a nvarchar field of 50 characters, when
in the SQL Server this fileld in the table only acepts 25 characters, I when
I call the update method it raised an error.

Thanks.

Jaime Lucci
(e-mail address removed)
 
exec sp_help tableName

This will give you all table info (like owner), columns, identity columns,
row guid columns and the filegroup they are on.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***********************************************
Think Outside the Box!
***********************************************
 
Yes. You're right. But this is in the SQL (Query Analyzer, for example) . I
need to do that in VB.Net. Can I use this SP? I need to import to VB.Net the
full structure of the table into a DataSet.

Thanks.
 
Yes, just call the stored procedure.

However, it's not like you can just recreate the equivalent of the database
table in a dataset. They are not the same thing.
 
Back
Top