SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Create Database Statement failed
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sunny_10
Yak Posting Veteran

65 Posts

Posted - 06/12/2013 :  02:11:50  Show Profile  Reply with Quote
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

India
52317 Posts

Posted - 06/12/2013 :  02:14:10  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

India
2215 Posts

Posted - 06/12/2013 :  02:15:42  Show Profile  Reply with Quote
Means Memory space for that specific primary file should have at least 3MB

--
Chandu
Go to Top of Page

Peter99
Constraint Violating Yak Guru

491 Posts

Posted - 06/14/2013 :  18:24:01  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000