Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2004
    Location
    NJ
    Posts
    37

    Unanswered: How do i retrieve table properties in MS SQL Server 2000

    I have looked on google and haven't found a query (as of yet) to perform this function.

    Essentially I am using VB.NET with Excel and have a mapping between a worksheet and a table in my database. I wrote an import function to pull the data out of excel and put it into SQL Server but I want to try catching errors before i do that.

    What is the SQL query to get column sizes from a table. Meaning in a table I have column1 that is allowed a size of int(5). How do i retrieve that information from a query opposed to just looking at it in SQL Server EM??

    any help would be appreciated
    thanks

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    SELECT * FROM INFORMATION_SCHEMA.Tables WHERE TABLE_NAME = 'myTable99'
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Feb 2004
    Location
    NJ
    Posts
    37
    I have used a query similar to that in the past to get a list of available tables in a database, but that isn't what I am looking for here.

    I am trying to find a query to extract the column properties out of that specific table to find out what the size allowed for an entry into that column.

    the query you sent me returns:
    dla_stage_v10 dbo OV3_IER BASE TABLE

    I am looking for something that says:
    table | DATA_TYPE | SIZE
    --------------------------------
    table1 | varchar | 5

    where data_type/SIZE are properties of that column

    Sorry if i am not making myself clear
    thanks!

  4. #4
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    My bad...you want .Columns, not .Tables
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  5. #5
    Join Date
    Feb 2004
    Location
    NJ
    Posts
    37
    cool. Thank you very much!!

  6. #6
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    No prob...hey where in Jersey?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

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