Can't create a database- keep getting an error message about model db

  • Hi,

    I'm trying to create a database on SQL Server 2005 Enterprise using the following script:

    CREATE DATABASE [MyDatabase_ALL] ON PRIMARY

    ( NAME = N'MyDatabase_ALL', FILENAME = N'C:\MyDatabase_ALL.mdf' , SIZE = 20480KB , FILEGROWTH = 1024KB )

    LOG ON

    ( NAME = N'MyDatabase_ALL_log', FILENAME = N'C:\Microsoft SQL Server\MSSQL\Data\MyDatabase_ALL_log.ldf' , SIZE = 20480KB , FILEGROWTH = 10%)

    GO

    However, I keep getting an error message:

    Msg 1807, Level 16, State 3, Line 1

    Could not obtain exclusive lock on database 'model'. Retry the operation later.

    Msg 1802, Level 16, State 4, Line 1

    CREATE DATABASE failed. Some file names listed could not be created. Check related errors.

    Any help is appreciated. It's a production server so I would like to avoid rebooting it.

    Thank you,

    Len

  • Check for what's running in the model database that it's conflicting with. There will be some incomplete transaction in model.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Thank you.

    Killed the active connection to model and it worked.

    Thank you

  • You're welcome.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 4 posts - 1 through 3 (of 3 total)

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