Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 71d640f

Browse files
issue 1192 fix
1 parent 5ae9cf2 commit 71d640f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

‎sp_DatabaseRestore.sql‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,23 @@ IF (SELECT RIGHT(@BackupPathLog, 1)) <> '\' --Has to end in a '\'
326326
END;
327327

328328
/*Move Data File*/
329+
IF NULLIF(@MoveDataDrive, '') IS NULL
330+
BEGIN
331+
RAISERROR('Getting default data drive for @MoveDataDrive', 0, 1) WITH NOWAIT;
332+
SET @MoveDataDrive = CAST(SERVERPROPERTY('InstanceDefaultDataPath') AS nvarchar(260));
333+
END;
329334
IF (SELECT RIGHT(@MoveDataDrive, 1)) <> '\' --Has to end in a '\'
330335
BEGIN
331336
RAISERROR('Fixing @MoveDataDrive to add a "\"', 0, 1) WITH NOWAIT;
332337
SET @MoveDataDrive += N'\';
333338
END;
334339

335340
/*Move Log File*/
341+
IF NULLIF(@MoveLogDrive, '') IS NULL
342+
BEGIN
343+
RAISERROR('Getting default log drive for @@MoveLogDrive', 0, 1) WITH NOWAIT;
344+
SET @MoveLogDrive = CAST(SERVERPROPERTY('InstanceDefaultLogPath') AS nvarchar(260));
345+
END;
336346
IF (SELECT RIGHT(@MoveLogDrive, 1)) <> '\' --Has to end in a '\'
337347
BEGIN
338348
RAISERROR('Fixing @MoveDataDrive to add a "\"', 0, 1) WITH NOWAIT;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /