bcp out - dump file to another domain

  • Hi,

    Im trying to dump a file from one of my SQL server to another domain... I have been tryig this option but Im not sure if I have something wrong or this is not possible

    DECLARE

    @cmdvarchar(255)

    ,@Createdvarchar(10)

    select@Created= ltrim(rtrim(convert(char(10), GETDATE(), 112))) -- ltrim(rtrim(convert(char(10), getdate(), 112)))

    set @cmd =

    'bcp VwHHRptLoadDb.dbo.AddressableAdDataBulk OUT \\10.10.10.10\packages\Folder\File_' + @Created + '.csv -c -t, -Udomain\user -Ppassword -Sservername -T'

    --SELECT @cmd

    exec [master]..xp_cmdshell @cmd

    I get this error:

    SQLState = 08001, NativeError = 11001

    Error = [Microsoft][SQL Native Client]TCP Provider: No such host is known.

    NULL

    SQLState = 08001, NativeError = 11001

    Error = [Microsoft][SQL Native Client]An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connecti

    ons.

    SQLState = S1T00, NativeError = 0

    Error = [Microsoft][SQL Native Client]Login timeout expired

    NULL

    any advice will be appreciated!

  • <<TCP Provider: No such host is known. >> try debugging why this message is coming....

    from source machine try below...

    ping to see ip is accesible

    telnet to below ports to ensure file copy ports are open...(try to manual copy file to see if it works)

    UDP 138, TCP 139, TCP 389, UDP 389, TCP 445, TCP 135

    Share your findings and result of any other troubleshooting you have done...

    Prakash Heda
    Lead DBA Team - www.sqlfeatures.com
    Video sessions on Performance Tuning and SQL 2012 HA

  • If there is a trust between the two domains, you should be able to grant access to the SQL service account to that resource. For troubleshooting try bcping to a local drive first, then concentrate on copying to another domain.

    A second issue is that the -U switch is for SQL Authentication. Try -E instead of U and P. Good luck!

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

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