It looks like something weird happened when copying and pasting the "SQL script to initiate a backup of a database."
SELECT @MyFileName='C:\PS\SQLScript\Backup\' + REPLACE(cast(cast(convert(nvarchar(20) as nvarchar(max)) as nvarchar(max)),cast(cast(GetDate() as nvarchar(max)) as nvarchar(max)),cast(cast(120 as nvarchar(max as nvarchar(max))))),':','-') + '.bak'
This portion does not even make sense:
cast(cast(convert(nvarchar(20) as nvarchar(max)) as nvarchar(max))
It looks like the code got over-processed by something after starting out something like this:
SELECT @MyFileName = N'C:\PS\SQLScript\Backup\' + REPLACE(CONVERT(nvarchar(max), GETDATE(), 120), N':', N'-')+ '.bak';
- This reply was modified 3 years, 6 months ago by JediSQL.