Kasun Perera
Kasun Perera

Reputation: 430

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:

What I can do without getting error message:

I'm using:

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.

Upvotes: 20

Views: 154155

Answers (11)

elkoki
elkoki

Reputation: 1

I got the same error while trying to access properties of any user under Databases>"AnyDataBase">Security>Users, I found that the error was purely about administrator privilegies for SMSS, I just ran it as administrator and it worked.

Upvotes: 0

Simeon
Simeon

Reputation: 836

For those who are unable to modify their SQL configuration due to administrative restrictions at work:

I was able to open a new query page by creating a SQL Server Scripts project and adding a new query through the solution explorer

Creating a SQL Server Scripts project and adding a new query through the solution explorer

Upvotes: -1

KALYAN  KONDAPURAM
KALYAN KONDAPURAM

Reputation: 9

I got the same message when I try to alter table to add new column . Issue is I haven't enclosed data types using '[' datatype ']' . Its Real data type. But It got fixed when I enclosed in using square braces.

Upvotes: 0

Patrick
Patrick

Reputation: 437

My solution for this was to extract the csv file with the python library pandas rather than saving it with Excel. Further, I removed columns that I didn't need as a few columns caused formatting errors during the import.

Upvotes: -1

kokoe johnson
kokoe johnson

Reputation: 5

I got the message after deleting a database. The database was gone, so I moved on.

Upvotes: -3

Timothy Gonzalez
Timothy Gonzalez

Reputation: 1928

I fixed the problem by running SSMS as administrator.

Upvotes: 12

expirat001
expirat001

Reputation: 2215

I got the same error for SQL 2016 and the only solution for me was to completely uninstall (in appwiz.cpl) all entries Visual Studio + SQL. Then I executed VisualStudioUninstaller and I reinstalled SQL and after Visual Studio.

Upvotes: 1

Muhammad Waqas Aziz
Muhammad Waqas Aziz

Reputation: 851

Its may be late, but i get the same error in SQL SERVER 2016, i resolved it by assigning full access to the back up folder.

Upvotes: 2

Nicolai Hansen
Nicolai Hansen

Reputation: 31

I got the same error message. Problem was 0 bytes free on the C: drive.

Upvotes: 3

sree
sree

Reputation: 1960

I faced the same error once in my project. This is purely due to SSMS(sql client) is corrupted. Just for cross check that server is fine and client is corrupted, try to connect to the sql-server in this machine from any other server if you have access and query the tables. If it returns data, just uninstall and reinstall the client(ssms) to solve the issue

Thanks

Upvotes: 1

Kasun Perera
Kasun Perera

Reputation: 430

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.

Upvotes: 5

Related Questions