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 2000 Forums
 SQL Server Administration (2000)
 How to specify server default db propertities
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

solart
Posting Yak Master

USA
148 Posts

Posted - 10/04/2002 :  16:28:06  Show Profile  Reply with Quote
SQL 2000, Service Pack 2

Using EM, one can click on the server (left pane) and then select propertities from the dropdown.

From the popup you can click on the Database Settings tab.

There is a frame within the Database Settings tab which allows you to enter the default location for a new database. In the same frame you can specify a location for the new database's log file.

Using T-SQL, how do you modify these defaults?

TIA solart

jasper_smith
SQL Server MVP & SQLTeam MVY

United Kingdom
846 Posts

Posted - 10/04/2002 :  18:05:40  Show Profile  Visit jasper_smith's Homepage  Reply with Quote
These settings are stored in the registry . EM uses an undocumented xp called xp_instance_regread to enumerate the relavent keys

xp_instance_regread N'HKEY_LOCAL_MACHINE',N'Software\Microsoft\MSSQLServer\MSSQLServer',
N'DefaultData'

xp_instance_regread N'HKEY_LOCAL_MACHINE',N'Software\Microsoft\MSSQLServer\MSSQLServer',
N'DefaultLog'


There is also an xp_instance_regwrite xp that will write to the registry e.g.

xp_instance_regwrite N'HKEY_LOCAL_MACHINE',N'Software\Microsoft\MSSQLServer\MSSQLServer',
N'DefaultData',REG_SZ,N'e:\sqldata\data'

xp_instance_regwrite N'HKEY_LOCAL_MACHINE',N'Software\Microsoft\MSSQLServer\MSSQLServer',
N'DefaultLog',REG_SZ,N'e:\sqldata\log'


These are undocumented (by MS - if you search google you will find articles on how they work)
and unsupported so use at own risk etc....



HTH
Jasper Smith
Go to Top of Page

solart
Posting Yak Master

USA
148 Posts

Posted - 10/07/2002 :  10:49:53  Show Profile  Reply with Quote
Many Thanks Jasper!!!

solart

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.08 seconds. Powered By: Snitz Forums 2000