A little off topic

  • This is a bit off topic and I didn't know where to ask so I decided to post it here because maybe some of you admins have seen this before. Its not even really SQL server related. I have a CSV that I am trying to query but the brilliant developer that created it used brackets in the field names. Example: Field[1], or Description[1]. You get the idea. I am trying to query this with the Microsoft text driver but it fails on these columns. I have tried enclosing it in the select list in more brackets like "Select [Field[1]] from" but that doesn't work. I have also tried double quotes with no help. I need to know what characters to wrap around this field name to make it work or if it can work at all. Any ideas?

    David

  • Wow. "Brilliant" is an understatement.

    Try the following...

    Select "Field[1]" from

    ... then find the Developer, the Manager, and the DBA that allowed the brackets and see if they like porkchops... at point blank range from a "Wrist Rocket".

    BTW... I don't know what your server settings are but you may have to turn "Quoted Identifiers" ON.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • I tried everything I could think of and ended up just using a "select *". I am executing this statement in VB using the Text ODBC Driver. I don't know if I can set "Quoted Identifiers" to be on unless I send it as part of the query that I am executing. I have never tried sending "T-SQL Like" syntax to a Text driver before.

    David

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply