CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 1999
    Location
    Bangalore
    Posts
    60

    how to get the datatype of a field in a table

    Can anybody tell me how to get the datatype and size of a field in a table using SQL or in VB

    Thanks in advance
    Venky



  2. #2
    Guest

    Re: how to get the datatype of a field in a table

    I Don't know which database you're using but in SQL_SERVER 6.5 if you use the system stored procedure sp_columns and pass it a table name as a string then it will return you the information that you want in
    TABLE_NAME,COLUMN_NAME,TYPE_NAME and LENGTH.
    ie sp_columns 'table1' will return all the columns in table1 along with their data types and lengths of those datatypes
    Hope this helps.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured