Re: Using DOS commands via xp_cmdshell
From: Andrew J. Kelly (sqlmvpnooospam_at_shadhawk.com)
Date: 10/06/05
- Next message: Digtinio Gonzalez: "Urgente Necisto evaluar un paquete de encriptacion para bases de datos SQL Server 2000"
- Previous message: Andy: "Re: Using DOS commands via xp_cmdshell"
- In reply to: Andy: "Re: Using DOS commands via xp_cmdshell"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 6 Oct 2005 12:48:12 -0400
As Mike stated you should get in the habit of not using mapped drives even
though it may have worked for you this time. That way you do not have to
deal with mapping and such and overall your code is less likely to break.
-- Andrew J. Kelly SQL MVP "Andy" <andy.stephenson@tesco.co.uk> wrote in message news:eY%23M8yoyFHA.2932@TK2MSFTNGP10.phx.gbl... > Thanks for the reply - got it sorted thanks. > > I used 'use net' via xp_cmdshell to map the drive with the correct > username & password, then do (i.e. copy) what I need to do, then unmap the > drive, all using xp_cmdshell. > > Cheers > Andy > > > "Mike Epprecht (SQL MVP)" <mike@epprecht.net> wrote in message > news:OSQkauoyFHA.1264@tk2msftngp13.phx.gbl... >> Hi >> >> 1. Forget about mapped drives, use UNC paths. >> 2. Make sure your SQL Server is running under a domain account that has >> permissions on the destination server. In your case, you need a trust >> relationship between the domains. >> >> >> Regards >> -------------------------------- >> Mike Epprecht, Microsoft SQL Server MVP >> Zurich, Switzerland >> >> IM: mike@epprecht.net >> >> MVP Program: http://www.microsoft.com/mvp >> >> Blog: http://www.msmvps.com/epprecht/ >> >> "Andy" <andy.stephenson@tesco.co.uk> wrote in message >> news:uWWF2hnyFHA.2880@TK2MSFTNGP12.phx.gbl... >>> Hi >>> >>> I'm trying to use the DOS copy command to copy a file from the servers >>> local drive to a mapped network drive (to a share on a different >>> domain). When I run the command in DOS, it works just fine, but when >>> running the same command using xp_cmdshell I get an error: "The system >>> cannot find the drive specified". >>> >>> Can anyone advise how I can get this to work? >>> >>> Thanks >>> Andy >>> >> >> > >
- Next message: Digtinio Gonzalez: "Urgente Necisto evaluar un paquete de encriptacion para bases de datos SQL Server 2000"
- Previous message: Andy: "Re: Using DOS commands via xp_cmdshell"
- In reply to: Andy: "Re: Using DOS commands via xp_cmdshell"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|