xp_cmdshell copy option is not working

  • exec master..xp_cmdshell 'copy D:\Databases\AllBackUp\ACCOUNT_MANAGEMENT_V1.2.bak D:\Databases\Release\ACCOUNT_MANAGEMENT_V1.3.bak'

    getting error 'The system cannot find the path specified.'

    when use same commant in cmd it's working...

    could someone tell what is isuue....

  • First ensure xp_cmdshell is enabled (you can do this under the surface area configuuration).

    Next make sure that the account SQL Server is logged in as has access to the Drive.

    What I'm thinking is that the SQL Server account does not have the proper access to see/read/write to the local drive outside of SQL Server.

    Marvin Dillard
    Senior Consultant
    Claraview Inc

  • First check if the file is accessible from query analyzer and/or the file actually exists

    ===========================================
    Better try and fail than not to try at all...

    Database Best Practices[/url]

    SQL Server Best Practices[/url]

  • Also, if the folder destination does not exist, xp_cmdshell will NOT create it as part of the copy, unlike several other windows programs which will.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

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

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