create database ldf file placement in sql 2005 is this a bug?

  • I am testing my first sql2005 install finally but have noticed something strange.

    If my logfile location for the model database is set to a diffent location from the data file I would have expected any databases created to have the same structure.

    IE I moved the ldf file for model to another drive. When I execute sp_helpdb 'model' the location is correct

    when I execute "Create database testdb"

    then run sp_helpdb 'testdb' the log file is located in the data file path.

    if I excute create database and specify file locations everything is ok.

    Any ideas?


    Trevor Hampson
    DBA

  • Opps.  I meant the propereties for your server, not your database.

  • Pull up the properties for your database.  Go to the Database Settings tab.  There you will find a section: Database default locations.  That is where you set the default locations for databases to be created.

  • Sorry forgot to mention that I tried that as well. if Model is the template for the database creations why would it not use how model is defined.

    Thanks for the reply.

     


    Trevor Hampson
    DBA

  • I have set the default locations on both SQL 2000 and SQL 2005 that way, and any databases I create through EM or SSMS have been created accordingly.  The only thing I have ever used model for was to add user-defined functions or types that I wanted to use in new databases without having to remember to run the scripts to create them when I created a new database.

  • We use the server property 'Database Settings' to set where the data and log default locations are and it always works for us. We use both 2000 and 2005.

    -SQLBill

  • the model database, or any database for that matter, does not contain within itself it's own storage location...that is kept in master....the model database is used for the default schema and objects that will be created.

     

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Thanks for the responses.


    Trevor Hampson
    DBA

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply