Monday, February 13, 2012

backup job step from remote server

I want to run a backup of a database against a remote server through a SQL
Agent job.
So I have the following TSQL Command in my job step. I know it works, but is
there something better ?
xp_cmdshell 'sqlcmd -S ServerA -Q "backup database test to disk = ''M:\backups\test.bak'' with init "'You could just do an OS cmd step and skip the xp_cmdshell. Or a linked
server with the proper permissions. I am not sure if those are much better
though...
--
Jason Massie
www: http://statisticsio.com
rss: http://feeds.feedburner.com/statisticsio
"Hassan" <hassan@.test.com> wrote in message
news:epMGCADRIHA.4684@.TK2MSFTNGP02.phx.gbl...
>I want to run a backup of a database against a remote server through a SQL
>Agent job.
> So I have the following TSQL Command in my job step. I know it works, but
> is there something better ?
> xp_cmdshell 'sqlcmd -S ServerA -Q "backup database test to disk => ''M:\backups\test.bak'' with init "'

No comments:

Post a Comment