I need to create a scheduled task that will backup a database within a SQL Server 2005 instance.
Is there a command line argument that I can use to achieve this?
I need to create a scheduled task that will backup a database within a SQL Server 2005 instance.
Is there a command line argument that I can use to achieve this?
Actually better here is to use SQLCMD instead of OSQL. OSQL is considered deprecated as of SQL Server 2005, though it's still around in SQL Server 2008.
As in:
Be sure you're running that as a user who has rights to backup that database (or, alternatively, use the "-U" and "-P" arguments to supply a username/password on the command line... not a good idea, thought.)