Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2004
    Location
    Long Island
    Posts
    696

    Unanswered: bcp issue on 2005

    bcp "exec SecurityMaster..usp_GetBBPerSecurityIdentifiers '01/28/2009'" queryout "Securities.txt" -U"USER" -P"PASSWORD" -S"sec-master" -c -t

    Works fine on 2000 but not 2005

    Get Error
    SQLState = HY000, NativeError = 0
    Error = [Microsoft][SQL Native Client]BCP host-files must contain at least one column

  2. #2
    Join Date
    Jun 2004
    Location
    Long Island
    Posts
    696
    osql -U"USER" -P"PASS" -Q "exec SecurityMaster..usp_GetBBPerSecurityIdentifiers '01/28/2009'" -S"sec-master" -h-1

    works fine

  3. #3
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Does the stored procedure include a line for SET NOCOUNT ON? I am also betting you have a temp table tucked in that procedure somewhere, too. Some older APIs get confused when they see "rows affected" messages, before any data.

  4. #4
    Join Date
    Jun 2004
    Location
    Long Island
    Posts
    696
    Quote Originally Posted by MCrowley
    Does the stored procedure include a line for SET NOCOUNT ON? I am also betting you have a temp table tucked in that procedure somewhere, too. Some older APIs get confused when they see "rows affected" messages, before any data.
    I changed the temp table to a perm table that I truncate and load, yes Nocount is set on. Like I said, works fine in 2000, 2005 no like. I got around it with sqlcmd call instead of BCP.

  5. #5
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Something else must be confusing it, then. At a random guess, does the procedure return a value? Or perhaps have output parameters?

    I would change the temp table back to temporary. You may end up with concurrent runs of this procedure, and troubleshooting that rats' nest is going to turn you gray pretty quick.

  6. #6
    Join Date
    Mar 2009
    Posts
    1
    Check that you do not have multiple bcp.exe's -one for 2000 and one for 2005. Use the one that is your database type.

  7. #7
    Join Date
    Jun 2004
    Location
    Long Island
    Posts
    696
    bcp 2005 no likee temp tables.

Posting Permissions

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