• Lynn Pettis (9/19/2012)


    Okay, don't know how many ways I can say it. It looks like you need to add the -S parameter to your BCP command line. Without it BCP is trying to connect to the default instance of SQL Server and you have specified that you are using a named instance on the new server. This means you need to tell bcp the name of the instance.

    This:

    SELECT @sMysql = 'bcp "SELECT sOutput FROM MYDATABASE.dbo.VPOSITIVEPAY" queryout ' + @sFilePath + @sFileName + ' -S [SQLSVR04\SS2005] -T -c'

    Notice the -S parameter I have added.

    Lynn,

    I did not see the -s param n any of the previous posts. It wasn't until this last post when the comments pointed to something not being seen that I realized there was more text then what I was seeing. My browser was only showing up thru to the '+@sFileName' piece and I did not reliaze there was anything more/diferfent after. If I had I certainly would not have continued to post lengthy messages and do tests when there was something to try that I had not done. Thank you.

    That said, it still failed and I copied your sample code just to make sure I did not miss anything or cotain any typos. And I did try it like this:

    SELECT @sMysql = 'bcp "SELECT sOutput FROM MYDATABASE.dbo.VPOSITIVEPAY" queryout ' + @sFilePath + @sFileName + ' -S [SQLSVR04\SS2005] -T -c'

    And like this just in case it made a difference:

    SELECT @sMysql = 'bcp "SELECT sOutput FROM [SQLSVR04\SS2005].MYDATABASE.dbo.VPOSITIVEPAY" queryout ' + @sFilePath + @sFileName + ' -S [SQLSVR04\SS2005] -T -c'

    What is DIFFERENT using the -S param is that the query fails when run from the old server and the new server. This is the first test where it failed when run from the old server.

    Thanks

    Kindest Regards,

    Just say No to Facebook!