Home Forums SQL Server 2005 T-SQL (SS2K5) trying to export to .CSV with comma delimited AND double-quotes RE: trying to export to .CSV with comma delimited AND double-quotes

  • cmcc (11/1/2012)


    🙁

    Didn't work.

    Getting this

    ...is too long. Maximum length is 128.

    I use a view for the data, which is short enough.

    It's getting the column names output that is causing me problems.

    I'd use SSIS but I don't have time - I've been fiddling with this problem in SSIS for six weeks now, off and on, and keep tripping over one SSIS issue after another.

    At least the BCP error makes sense to me.

    In SSIS I have to change the file names - they have to be the date the package is run or the date from a parameter I have to pass in. This is a piece of cake from a parameter in a stored procedure but is taking a while to work through in SSIS.

    i.e. I haven't gotten it to work yet.

    ARGH!!!!

    Post your BCP command for this because, as you can see, my command is larger than 128. What may be wrong is a very large column name that QUOTENAME is tripping over. There's a fairly easy fix for that but it would help to see the actually BCP command you're using.

    Also... do any of the columns in the BCP command have a datatype larger than VARCHAR(128) or NVARCHAR(64)???

    --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)