• gary1 (7/4/2013)


    So in the @filename, I'm giving the log backup path as @filename=''Z:\Backups\VS1$ABCINS1\WSS_Content_DB1\LOG''

    That is not what you have to do. You are changing the variable part into a hard-coded string. This hard-coded string will be returned in each row selected, hence every generated commandline has exactly the same text as filename.

    If you look at my code, you see I select the value for @filename from each row out of the column "physical_device_name". This value has the full path included, so you can just run the code and leave the SELECT part of my code unchanged.

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **