Sript Name with Current Date

  • The ISO date format is probably best for this; so something like:

    DECLARE @DiskStr NVARCHAR(255)

    SET @DiskStr = N'C:\CollSoftware2_' + CONVERT(NVARCHAR(8), GETDATE(), 112) + N'.bak'

    BACKUP DATABASE [CollSoftware2]

    TO  DISK = @DiskStr

    WITH  INIT , NOUNLOAD , Name = N'CollSoftware2',  NOSKIP ,  STATS = 10,  NOFORMAT

Viewing post 1 (of 2 total)

You must be logged in to reply to this topic. Login to reply