using OSQL command lines - a better way?

Last post 05-08-2008, 1:50 PM by Phil Factor. 1 replies.
Sort Posts: Previous Next
  •  04-23-2008, 9:14 AM Post number 48247

    using OSQL command lines - a better way?

    I'll start by saying I am not very familiar with SQL but have picked up a few things here and there to accomplish what I needed to.  I currently use an OSQL command in a batch file, and then have the file executed as a scheduled task, to automate the backing up of a SQL database to a .bck file ( I posted about this previously).

    My question is, is there a better way to do this?  Is it possible to have SQL enterprise manager create a backup to a .bck file on a schedule?  Or is it possible to just have enterprise manager call that batch file, instead of having windows do it?  The reason I ask is that we run into trouble every now and then with running this a scheduled task from the batch file, because of windows user account passwords expiring, and the task not running as a result.

    Thanks,
    Kevin
  •  05-08-2008, 1:50 PM Post number 51591 in reply to post number 48247

    Re: using OSQL command lines - a better way?

    It isn't the Enterprise manager that does it but the SQL Server Agent on the server you are logged into via Enterprise manager.. The server on which your SQL Server is installed will have two schedulers: the Windows scheduler, and the SQL Server Agent. It is always better to do it on the SQL Server Agent because of the history and the errorlog. Also, you can get it to fire an alert if a job fails.

    There is nothing wrong with using OSQL on Windows Scheduler. It isn't quite as resilient as an agent Job and you don't get alerts.
View as RSS news feed in XML