Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 5123

Weird backup query issue

$
0
0

Hi,

We have a custom scripts for doing nightly full backup and we use the following command to find the databases for which to do the backups:

select name from sys.databases where name not in ('tempdb','model') and state_desc='ONLINE' order by database_id desc

OR

select name from sys.databases where name not in ('tempdb','model') and state_desc='ONLINE' order by name desc

Somehow both of these command when run from query analyzer works but when we are running from SQL Server agent job, they miss the backup for few databases and not give any warning/error messages and then suddenly starts working for few days and the stop again and that is causing disruption in our DR strategy.

Any idea what can be the possible issue or is there any other command that we should be using

We see issue on all versions: SQL Server 2008 R2, 2014


Viewing all articles
Browse latest Browse all 5123

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>