Using SQLExpress Manager to Create Database

I got this error message when I tried to use an alternative place for the data files, I have checked the permissions on the destination directory, and I can't see any reason why this would happen

=============================================

Create failed for Database 'Database_1'.  (Microsoft.SqlServer.Smo)

----------------------------------------
For help, click: http://go.microsoft.com/fwlink ProdName=Microsoft SQL Server&ProdVer=9.00.1116.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+Database&LinkId=20476

----------------------------------------
Program Location:

   at Microsoft.SqlServer.Management.Smo.SqlSmoObject.CreateImpl()
   at Microsoft.SqlServer.Management.Smo.Database.Create()
   at Microsoft.SqlServer.ExpressManager.Commanders.DatabaseCommander.DatabaseModel.ApplyChanges()
   at Microsoft.SqlServer.ExpressManager.Commanders.DatabaseCommander.DatabaseMainController.ApplyChanges()
   at Microsoft.SqlServer.ExpressManager.Framework.CommanderHost.OK()

=============================================

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

----------------------------------------
Program Location:

   at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
   at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(StringCollection sqlCommands, ExecutionTypes executionType)
   at Microsoft.SqlServer.Management.Smo.ExecutionManager.ExecuteNonQuery(StringCollection queries, Boolean bUseMaster)
   at Microsoft.SqlServer.Management.Smo.SqlSmoObject.ExecuteNonQuery(StringCollection queries, Boolean includeDbContext)
   at Microsoft.SqlServer.Management.Smo.SqlSmoObject.CreateImplFinish(StringCollection createQuery, ScriptingOptions so)
   at Microsoft.SqlServer.Management.Smo.SqlSmoObject.CreateImpl()

=============================================

The file "D:\Database Files\Database_1.mdf" is compressed but does not reside in a read-only database or filegroup. The file must be decompressed.
CREATE DATABASE failed. Some file names listed could not be created. Check related errors. (.Net SqlClient Data Provider)

----------------------------------------
For help, click: http://go.microsoft.com/fwlink ProdName=Microsoft%20SQL%20Server&ProdVer=09.00.1116&EvtSrc=MSSQLServer&EvtID=5118&LinkId=20476

----------------------------------------
Server Name: OFFICEPC\SQLEXPRESS
Error Number: 5118
Severity: 16
State: 1
Line Number: 1


----------------------------------------
Program Location:

   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)




Answer this question

Using SQLExpress Manager to Create Database

  • MarkDuffy

    Yes C: and D: is compressed.

    and looking at Explorer, I can see that the path
    C:\Program Files\Microsoft SQL Server\MSSQL\Data

    Is not compressed for some reason, while other files are


    I am decompressing now, but it's going to take a few hours, hopefully that should be the cause

    Thanks!




  • KCReed

    Is your D drive a compressed Drive

    -Euan

  • JMZuniga

    It should be as databases are not supported on compressed drives

  • Using SQLExpress Manager to Create Database