|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
get table structureHi 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 jaimelu***@hotmail.com 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. -- Show quoteGregory A. Beamer MVP; MCP: +I, SE, SD, DBA *********************************************** Think Outside the Box! *********************************************** "Jaime Lucci" <jaimelu***@hotmail.com> wrote in message news:OYYAniX4FHA.1420@TK2MSFTNGP09.phx.gbl... > 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 > jaimelu***@hotmail.com > > 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. Show quote "Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@comcast.netNoSpamM> wrote in message news:%23vaualX4FHA.696@TK2MSFTNGP09.phx.gbl... > 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! > *********************************************** > "Jaime Lucci" <jaimelu***@hotmail.com> wrote in message > news:OYYAniX4FHA.1420@TK2MSFTNGP09.phx.gbl... > > 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 > > jaimelu***@hotmail.com > > > > > > 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. Show quote "Jaime Lucci" <jaimelu***@hotmail.com> wrote in message news:uoQt92X4FHA.2600@tk2msftngp13.phx.gbl... > 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. > > "Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@comcast.netNoSpamM> wrote in > message news:%23vaualX4FHA.696@TK2MSFTNGP09.phx.gbl... >> 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! >> *********************************************** >> "Jaime Lucci" <jaimelu***@hotmail.com> wrote in message >> news:OYYAniX4FHA.1420@TK2MSFTNGP09.phx.gbl... >> > 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 >> > jaimelu***@hotmail.com >> > >> > >> >> > > |
|||||||||||||||||||||||