SQL Server Performance

Using BDE with information schema view

Discussion in 'General DBA Questions' started by Chappy, Jan 14, 2003.

  1. Chappy New Member

    I have a query which selects a list of columns in a given table. This works fine from Query Analyser and returns column name and type as requested, and has 127 rows.

    --
    SELECT COLUMN_NAME, DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'TechnicalData' and COLUMN_NAME <> 'TD_ID'
    --

    When this recordset is retrieved through the Borland Database Engine, I am only able to see a recordset 0 columns. However, the number of rows is 127 as it should be.

    I then created a stored procedure containing my query, and call that from BDE instead, using aliased column names (incase this was conflicting internally with BDE). The problem is the same.

    Has anyone experienced this problem ? I am unable to access the field data returned from the schema view.
    In a perfect world I could just migrate this bit of code to ADO, but this is sadly not a possibility.

    Thanks for any advice.
  2. Chappy New Member

    Problem solved. Seems I had to do

    SELECT "A"=CONVERT(VARCHAR(254), COLUMN_NAME), "B"=CONVERT(VARCHAR(254), DATA_TYPE) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'TechnicalData' and COLUMN_NAME <> 'TD_ID'

Share This Page