get table structure

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)
 
C

Cowboy \(Gregory A. Beamer\)

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!
***********************************************
 
J

Jaime Lucci

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

Marina

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top