pretty me
pretty me

Reputation: 559

What may be the reason why SQL Server not running in services?

What can I do with this I have an error on running the SQL Server Express service

Windows could not start the SQL Server on local computer...

EDIT:

By the way I have looked at the event log and I found this

The log scan number (85:368:1) passed to log scan in database 'model' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during start up.

EDIT II:

I did all suggestions but it still not running(sql express server service) can anyone help me to do this?

Upvotes: 9

Views: 21010

Answers (4)

Fuji Nguyen
Fuji Nguyen

Reputation: 79

If you use the regular MSSQL 12 (instead of SQLExpress) follow the instructions below:

  1. Go to folder C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Binn\Templates
  2. Copy the template database files model and modellog to folder C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA
  3. Restart the SQL Server (MSSQLSERVER) in Services control panel
  4. To verify the fix, connect to database engine using Microsoft SQL Management Studio

Upvotes: 7

pretty me
pretty me

Reputation: 559

To those who has the same problem as mine try doing this. here are the things that i have done just to solve this:

First: Go to this path C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\Binn\Templates

Second: Copy and paste the database/file named model.mdf and modellog.ldf to this path C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA

That's it.. Thanks to those who answers my question..

Upvotes: 35

Polux2
Polux2

Reputation: 592

You have to rebuild the Database : 'model'. The simpliest way is to copy this 2 files model.mdf and modellog.ldf from a working instance.

You can also use this command to rebuild system database Setup QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=InstanceName /SQLSYSADMINACCOUNTS=accounts [/ SAPWD= StrongPassword ] [ /SQLCOLLATION=CollationName] See here

Upvotes: 1

Bhavik Jani
Bhavik Jani

Reputation: 180

  • If you never install SQL Server on your machine then do not try to install visual studio first.

  • Always install SQL Server first.

  • To remove and re-install you have to remove all the SQL server instance and then install.

Upvotes: 0

Related Questions