Results 1 to 2 of 2

Thread: Code to list DBF tables & Tables fields

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    Manizales,Colombia
    Posts
    1

    Question

    Hello:

    I need to build SQL interactively.

    I mean having a working directory I need
    to list the tables there, choose one and then
    in a combo box, I think, see its fields to choose
    one, and maybe the values to build the SQL.

    Can anybody please help me with this?

    thanks in advance
    Oscar Hernan Ramirez O
    GIS Assessor
    MAnizales, Colombia

  2. #2
    Lively Member
    Join Date
    Jul 2000
    Location
    Stockholm, Sweden
    Posts
    83
    Have you discovered the system objects in MS SQL Server ?

    Enter the SQL Server Enterprise Manager and click on your server, /Action /Edit SQL Server Registration and check the "Show system database and system objects" CheckBox.

    You now for example can look at the two wievs named TABLES and COLUMNS.

    You could also directly look at the system tables.

    This query will give you all user defined tables ('U') and all user defined views ('V').
    Code:
    SELECT
     name,
     id
    FROM
     sysobjects
    WHERE
     ( xtype = 'U' OR
       xtype = 'V')
    AND
     userstat = 1
    And use the returned Id to get the columns

    Code:
    SELECT
     name
    FROM
     syscolumns
    WHERE
     id = 117575457 /* The number for one of my own table */
    I think that this will get you started. I don't know more for now because I figured it out during the day and it is possible that I have missed something.
    Yesterday, all my troubles seemed so far away...
    Help, I need somebody, Help...
    Now MCSD and still locking for intresting job in the south parts of Stockholm, Sweden.

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