Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Create Database Statement failed

Author  Topic 

sunny_10
Yak Posting Veteran

72 Posts

Posted - 2013-06-12 : 02:11:50
Hi

I am creating table like this but
It is giving me error on Windows 8 Basic "The Create Database Statement failed . The primary file must be atleast 3 MB to accomodate a copy of the model database

str = "CREATE DATABASE " & mydatabase & " ON PRIMARY " & _
"(NAME = " & "WeighBridge" & Mid(fyear, 1, 2) & "_" & Mid(fyear, 4, 2) & "_Data" & ", " & _
" FILENAME = '" & m_path & "Data\" & "WeighBridge" & Mid(fyear, 1, 2) & "_" & Mid(fyear, 4, 2) & ".mdf' , " & _
" SIZE = 2MB, " & _
" MAXSIZE = 20MB, " & _
" FILEGROWTH = 10%) " & _
" LOG ON " & _
"(NAME = " & "WeighBridge" & Mid(fyear, 1, 2) & "_" & Mid(fyear, 4, 2) & "_Log" & ", " & _
" FILENAME = '" & m_path & "Data\" & "WeighBridge" & Mid(fyear, 1, 2) & "_" & Mid(fyear, 4, 2) & ".ldf ', " & _
" SIZE = 1MB, " & _
" MAXSIZE = 10MB, " & _
" FILEGROWTH = 10%) "
confind.Execute (str)


Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-06-12 : 02:14:10
quote:
Originally posted by sunny_10

Hi

I am creating table like this but
It is giving me error on Windows 8 Basic "The Create Database Statement failed . The primary file must be atleast 3 MB to accomodate a copy of the model database

str = "CREATE DATABASE " & mydatabase & " ON PRIMARY " & _
"(NAME = " & "WeighBridge" & Mid(fyear, 1, 2) & "_" & Mid(fyear, 4, 2) & "_Data" & ", " & _
" FILENAME = '" & m_path & "Data\" & "WeighBridge" & Mid(fyear, 1, 2) & "_" & Mid(fyear, 4, 2) & ".mdf' , " & _
" SIZE = 2MB, " & _
" MAXSIZE = 20MB, " & _
" FILEGROWTH = 10%) " & _
" LOG ON " & _
"(NAME = " & "WeighBridge" & Mid(fyear, 1, 2) & "_" & Mid(fyear, 4, 2) & "_Log" & ", " & _
" FILENAME = '" & m_path & "Data\" & "WeighBridge" & Mid(fyear, 1, 2) & "_" & Mid(fyear, 4, 2) & ".ldf ', " & _
" SIZE = 1MB, " & _
" MAXSIZE = 10MB, " & _
" FILEGROWTH = 10%) "
confind.Execute (str)


Thanks


As error suggests increase size of mdf file may be 5 MB to start with

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-06-12 : 02:15:42
Means Memory space for that specific primary file should have at least 3MB

--
Chandu
Go to Top of Page

Peter99
Constraint Violating Yak Guru

498 Posts

Posted - 2013-06-14 : 18:24:01
As Model database have mdf file size set to 3MB, set your MDF file to 3+MB, it should works.
Go to Top of Page
   

- Advertisement -