Exception calling "SqlBackup" with "1" argument(s): "Backup failed for Server -
i getting error on sql2012r2 work on sql2016 out hic
exception calling "sqlbackup" "1" argument(s): "backup failed server 'devsqld01'. "
script:
[system.reflection.assembly]::loadwithpartialname("microsoft.sqlserver.smo") | out-null [system.reflection.assembly]::loadwithpartialname("microsoft.sqlserver.smoextended") | out-null [system.reflection.assembly]::loadwithpartialname("microsoft.sqlserver.connectioninfo") | out-null [system.reflection.assembly]::loadwithpartialname("microsoft.sqlserver.smoenum") | out-null $server = new-object ("microsoft.sqlserver.management.smo.server") $servername $dbname = "staging-xtra" $timestamp = get-date -format yyyy-mm-dd-hhmmss $targetpath = $backupdirectory + "\" + $dbname + "_" + $timestamp + ".bak" $smobackup = new-object ("microsoft.sqlserver.management.smo.backup") $smobackup.action = "database" $smobackup.backupsetdescription = "full backup of " + $dbname $smobackup.backupsetname = $dbname + " backup" $smobackup.database = $dbname $smobackup.mediadescription = "disk" $smobackup.devices.adddevice($targetpath, "file") $smobackup.sqlbackup($server)
exception calling "sqlbackup" "1" argument(s): "backup failed server 'devsqld01'. "
Comments
Post a Comment