Friday, February 17, 2012

create database statement

Where does the SQL Server default the "file name" parameter when you create
a database WITHOUT entering your own parameter for "file name".
You can do a simple "create database somename" and it will create the
database with the defaulted "file name" to be where SQL Server is installed
(location of the mdf and ldf). Does SQL Server take the default location
from the model or master databases or some file group setting?
Thanks in advanceI believe it defaults to the location of model. You can change this in EM
by right-clicking on your server and changing the defaults in the server
properties dialog, or by modifying the registry directly. The defaults are
stored at HKLM\Software\Microsoft\MSSQLServer\MSSQLServer. Two keys:
DefaultData and DefaultLog, which should both be REG_SZ. Note that if you
haven't previously modified this setting in EM, the keys will not yet exist.
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"Homer" <Homer@.discussions.microsoft.com> wrote in message
news:66B065D1-287D-485E-B3C5-425852D83EFE@.microsoft.com...
> Where does the SQL Server default the "file name" parameter when you
> create
> a database WITHOUT entering your own parameter for "file name".
> You can do a simple "create database somename" and it will create the
> database with the defaulted "file name" to be where SQL Server is
> installed
> (location of the mdf and ldf). Does SQL Server take the default location
> from the model or master databases or some file group setting?
> Thanks in advance|||The following article should explain the New Database default locations.
Basically though these values are stored in the registry for each SQL server
instance.
http://www.wardyit.com/blog/blog/archive/2005/11/10/58.aspx
- Peter Ward
WARDY IT Solutions
"Homer" wrote:
> Where does the SQL Server default the "file name" parameter when you create
> a database WITHOUT entering your own parameter for "file name".
> You can do a simple "create database somename" and it will create the
> database with the defaulted "file name" to be where SQL Server is installed
> (location of the mdf and ldf). Does SQL Server take the default location
> from the model or master databases or some file group setting?
> Thanks in advance

No comments:

Post a Comment