Please help!!! BCP File Export

  • Please help trying to run the below script to export to a txt file, on my local servers they work, generated the files fine, im local admin on the account im logged in as and sysadmin on the account im logged into MSSQL 2000

    SET @strLineDate = '\\FILELOCATION\Balance File\Export' + convert(nvarchar(8),GetDate(),112) + '.txt'

    SET @bcpCommand = 'bcp "select Outline from ##CRSTemp order by RowCounter" queryout "'

    SET @bcpCommand = @bcpCommand + @strLineDate + '" -S -U -P -c'

    SET QUOTED_IDENTIFIER ON

    PRINT @bcpCommand

    exec master..xp_cmdshell @bcpCommand

    SET QUOTED_IDENTIFIER OFF

    SET CONCAT_NULL_YIELDS_NULL ON

    Drop table ##CRSTemp

    GO

    Totally lost getting the below error message

    SQLState = 08001, NativeError = 14

    Error = [Microsoft][ODBC SQL Server Driver][Shared Memory]Invalid connection.

    SQLState = 01000, NativeError = 14

    Warning = [Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionOpen (Invalid Instance()).

    NULL

  • slimtonone (4/1/2009)


    Please help trying to run the below script to export to a txt file, on my local servers they work, generated the files fine, im local admin on the account im logged in as and sysadmin on the account im logged into MSSQL 2000

    SET @strLineDate = '\\FILELOCATION\Balance File\Export' + convert(nvarchar(8),GetDate(),112) + '.txt'

    SET @bcpCommand = 'bcp "select Outline from ##CRSTemp order by RowCounter" queryout "'

    SET @bcpCommand = @bcpCommand + @strLineDate + '" -S -U -P -c'

    SET QUOTED_IDENTIFIER ON

    PRINT @bcpCommand

    exec master..xp_cmdshell @bcpCommand

    SET QUOTED_IDENTIFIER OFF

    SET CONCAT_NULL_YIELDS_NULL ON

    Drop table ##CRSTemp

    GO

    Totally lost getting the below error message

    SQLState = 08001, NativeError = 14

    Error = [Microsoft][ODBC SQL Server Driver][Shared Memory]Invalid connection.

    SQLState = 01000, NativeError = 14

    Warning = [Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionOpen (Invalid Instance()).

    NULL

    I realize that it has been quite a while since you posted this problem. Have you been able to resolve the issue or is it still an open problem?

    I was looking at your BCP command line options and what i noticed was that you don't appear to be providing the servername, username, or password with the -S, -U, and -P arguments.

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

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