Re: Run As Command
- From: "vt" <vinu.t.1976@xxxxxxxxx>
- Date: Tue, 22 May 2007 09:05:55 +0100
Rick
here is how you can do it
SELECT @VCHCOMMAND = 'net use v: \\10.1.97.150\sqlbackups$\SRDEV dbbackup
/user:XXXX\srdev_db_backup'
EXEC @IRESULT = MASTER..XP_CMDSHELL @VCHCOMMAND, NO_OUTPUT
where v: is the share name
dbbackup : password to connect \\10.1.97.150\sqlbackups$\SRDEV
XXXX\srdev_db_backup : is the user login on the destination server
if you are using BACKUP DATABASE command to backup the database then
issue the above command first and then backup up the database on to v:
hope this helps you
Regards
VT
Knowledge is power, share it....
http://oneplace4sql.blogspot.com/
"Rick" <Rick@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:042AEE4F-6267-4EA8-8BB6-4609B32409DB@xxxxxxxxxxxxxxxx
I need to copy a backup file from server to server in seperate domains.
Unfortunately in my company they do not have trusted connections. So I
need
to use a seperate logon for the destination server. I have tried a mapped
drive that is mapped as a valid logon in thatdomain with no luck, I get
"cannot find the drive specified." Is there a way thorugh sql server to
run a
job or a copy as something different than the SQL Agent account. FYI, the
logon that I use to logon to the other domain cannot be registered as a
logon
to SQL server bacause SQL Server cannot see that domain. Any suggestions?
.
- Follow-Ups:
- Re: Run As Command
- From: Rick
- Re: Run As Command
- Prev by Date: Re: Run As Command
- Next by Date: SQL 2005 - permissions - remove button greyed out
- Previous by thread: Re: Run As Command
- Next by thread: Re: Run As Command
- Index(es):