sql-serverssms

SQL Server 2012 error: object reference not set to an instance of an object


I use SQL Server 2012 and I have some databases on it. The problem is I suddenly get an error saying,

object reference not set to an instance of an object

I get this error when:

  • Going to write a new query
  • Select previously entered data by right click the table name -> Select top 1000 rows

What I can do without getting error message:

  • Log into my instance successfully using both Windows Authentication mode and SQL Authentication mode.
  • Edit the table data by right click the table name -> Edit top 200 rows
  • Create a new database

I'm using:

  • Microsoft SQL Server Management Studio: 11.0.3128.0
  • Microsoft .NET Framework: 4.0.30319.34014
  • Operating System: Windows 8.1

Here are some snapshots of the error. error

Advanced_information

Please give me a solution to fix this problem. Your help will be highly appreciated.


Solution

  • I could solve the error. Repair the SQL Server.

    Go to Add/remove programs Microsoft SQL Server 2012(x64) -> Uninstall/Change -> Repair. Select the instance that you want to repair here.

    Select the instance

    For me, after repairing the instance, the error was solved.

    Thanks for all who spent their valuable time to reply my question.