I am having a problem. Here is the query that I am doing.
IF EXISTS (SELECT *
FROM master..sysdatabases
WHERE name = N'CVIEW')
DROP DATABASE CVIEW
GO
CREATE DATABASE CVIEW
GO
-- =====================
-- Restore Database
-- =====================
USE master
GO
-- First determine the number and names of the files in the backup.
RESTORE FILELISTONLY
FROM DISK = N'c:\xCVIEW\Data Dump\XCVW20010519.dbk'
-- Restore the files for new Db.
RESTORE DATABASE CVIEW
FROM DISK = N'c:\xCVIEW\Data Dump\XCVW20010519.dbk'
WITH RECOVERY,
MOVE 'CVIEW_Data' TO 'C:\Program Files\Microsoft SQL Server\MSSQL\data\CVIEW_Data.mdf',
MOVE 'CVIEW_Log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL\data\CVIEW_Log.ldf'
GO
This should create a new database and then restore a dbk file to create all the indexes and tables. The error that I am getting is
The CREATE DATABASE process is allocating 0.63 MB on disk 'CVIEW'.
The CREATE DATABASE process is allocating 0.49 MB on disk 'CVIEW_log'.
(2 row(s) affected)
Server: Msg 3234, Level 16, State 2, Line 5
Logical file 'CVIEW_Data' is not part of database 'CVIEW'. Use RESTORE FILELISTONLY to list the logical file names.
Server: Msg 3013, Level 16, State 1, Line 5
RESTORE DATABASE is terminating abnormally.
How do I fix this? I also want to know when I create the database, how can I specify the log size and the data file size? I want them both to be 2000 meg rather than .49 meg and .63 meg. Thanks
IF EXISTS (SELECT *
FROM master..sysdatabases
WHERE name = N'CVIEW')
DROP DATABASE CVIEW
GO
CREATE DATABASE CVIEW
GO
-- =====================
-- Restore Database
-- =====================
USE master
GO
-- First determine the number and names of the files in the backup.
RESTORE FILELISTONLY
FROM DISK = N'c:\xCVIEW\Data Dump\XCVW20010519.dbk'
-- Restore the files for new Db.
RESTORE DATABASE CVIEW
FROM DISK = N'c:\xCVIEW\Data Dump\XCVW20010519.dbk'
WITH RECOVERY,
MOVE 'CVIEW_Data' TO 'C:\Program Files\Microsoft SQL Server\MSSQL\data\CVIEW_Data.mdf',
MOVE 'CVIEW_Log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL\data\CVIEW_Log.ldf'
GO
This should create a new database and then restore a dbk file to create all the indexes and tables. The error that I am getting is
The CREATE DATABASE process is allocating 0.63 MB on disk 'CVIEW'.
The CREATE DATABASE process is allocating 0.49 MB on disk 'CVIEW_log'.
(2 row(s) affected)
Server: Msg 3234, Level 16, State 2, Line 5
Logical file 'CVIEW_Data' is not part of database 'CVIEW'. Use RESTORE FILELISTONLY to list the logical file names.
Server: Msg 3013, Level 16, State 1, Line 5
RESTORE DATABASE is terminating abnormally.
How do I fix this? I also want to know when I create the database, how can I specify the log size and the data file size? I want them both to be 2000 meg rather than .49 meg and .63 meg. Thanks