|
Posted by Antonio Mazzeo on August 29, 2005, 3:30 pm
Please log in for more thread options
> Antonio,
>
> I just tried to run the following db_backup.cmd but get an error on the +
> sign. Here is the exact syntax of the command with the error message:
>
> C:Program FilesMicrosoft Retail Management System>OSQL -U UserName -P
> password -S TCS50
> -Q "BACKUP DATABASE main TO DISK = 'c:Program FilesMicrosoft Retail
> Management SystemBackupBackup-' + str(year(getdate())) +
> str(month(getdate())) + str(day(getdate())) '.bck' WITH FORMAT, STATS"
> Msg 170, Level 15, State 1, Server TCS50, Line 1
> Line 1: Incorrect syntax near '+'.
DECLARE @fullpath nvarchar(255)
set @fullpath = 'c:Program FilesMicrosoft Retail
Management SystemBackupBackup-' + str(year(getdate())) +
str(month(getdate())) + str(day(getdate())) + '.bck'
BACKUP DATABASE main TO DISK = @fullpath WITH FORMAT, STATS
sorry for my error
antonio
|