• The following worked on my laptop system which uses a named instance for SQL Server 2005:

    bcp "select * from master.sys.databases" queryout C:\Users\lynn.pettis\testfile.txt -S ISS203897\ISS2K5 -T -c

    The following failed on my laptop system which uses a named instance for SQL Server 2005:

    bcp "select * from master.sys.databases" queryout C:\Users\lynn.pettis\testfile.txt -T -c

    So, with that, try this:

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