Getting error "Failed to create destination folder" for xp_restore_database when using parameter @with.
The scriot is like the one below:
exec master.dbo.xp_restore_database @database = 'testDb',
@filename = 'test.lbk',
@with ='REPLACE',
@with ='STATS',
@with ='MOVE "test1" TO "J:\test.mdf"',
@with ='MOVE "test1Log" TO "I:\test1Log.ldf"'
The problem is the double quotes in the @with parameter
RESOLUTION
Use single quotes instead of double quotes in the @with parameter.
Then script should be
exec master.dbo.xp_restore_database @database = 'testDb',
@filename = 'test.lbk',
@with ='REPLACE',
@with ='STATS',
@with ='MOVE "test1''' TO "J:\test.mdf''',
@with ='MOVE "test1Log'' TO "I:\test1Log.ldf'''
© ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center