I stumbled on this issue when I had scripted out a database from ServerA to ServerB. I ran the script generated from ServerA on ServerB and thought nothing of it. Later, I then tried to restore the database backup from ServerA to ServerB using with move because the drive configs are different. Well… it wouldn’t restore because when scripting the database from ServerA Toad changed the logical and physical names. The issue was obvious, it couldn’t find one of the logical names i was using so it failed. The logical files in the backup were not the logical file name that Toad scripted out.
I really do not want TOAD to anything fancy but just script what is there. Why is it going in and changing anything?
See below for example:
Screen shot of database files: (SERVERA)
This is the script it generated: (script created via Toad, SERVERB)
CREATE DATABASE [Test_Toad_Scripting]
ON
PRIMARY
( NAME = N’Test_Toad_Scripting’, FILENAME = N’xxxxx\Test_Toad_Scripting.mdf’, SIZE = 4MB, FILEGROWTH = 1MB ),
( NAME = N’Test_Toad_Scripting_1’, FILENAME = N’xxxxx\Test_Toad_Scripting_1.ndf’, SIZE = 4MB, FILEGROWTH = 1MB )
LOG ON
( NAME = N’Test_Toad_Scripting_log’, FILENAME = N’xxxxx\Test_Toad_Scripting_log.ldf’, SIZE = 1MB, MAXSIZE = 2097152 MB, FILEGROWTH = 10% )
COLLATE SQL_Latin1_General_CP1_CI_AS;
** In the script it rename my logical file from DataFile & DataFile2 to Test_Toad_Scripting & Test_Toad_Scripting_1 respectively. WHY? Am I missing something?
Has anyone else come accross this? Is there a check box anywhere to have Toad just script what it there and not try to figure what it thinks the files should be called?