December 22, 2020 at 12:00 am
Comments posted to this topic are about the item Scheduling SQL Scripts Using Jenkins
Vishnu Gupthan
PowershellAcademy
www.powershellacademy.com
December 22, 2020 at 6:32 pm
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';
Sincerely,
Daniel
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy