Help: SQL Server

Sharing my knowlege about SQL Server Troubleshooting Skills

  • Blog Stats

    • 2,106,067 hits
  • Select GETDATE()

    July 2012
    M T W T F S S
     1
    2345678
    9101112131415
    16171819202122
    23242526272829
    3031  

Help: Getting error “Value cannot be null” while opening management studio. Which value?

Posted by blakhani on July 23, 2012


One of my friend emailed me today to troubleshoot a problem with SQL Server Management Studio. Here is the problem statement in his own words.

Hey Balmukund,
I know you are the one you can save me now.

I have a problem with my production SQL Server. When I am trying to connect via management studio, I am getting below error

clip_image001

Once I hit OK, I can get in to management studio but can’t expand any node completely.

Using Bingoogle, I found that this can be rectified by tweaking some registry entries. I do not want to take that route, instead want to uninstall only SSMS and install it back.

One of your reply on MSDN shows that you were not able to reproduce the problem. Let me know if you want to troubleshoot this live with me.

Friend:waiting your comments,
<Name not displayed>

For better search here is the text of the message

TITLE: Microsoft SQL Server Management Studio
——————————
Value cannot be null.
Parameter name: viewInfo (Microsoft.SqlServer.Management.SqlStudio.Explorer)
——————————
BUTTONS:
OK
——————————

Once I reached office, I pinged him today and started my day! I followed my usual ways of troubleshooting with a series of question to nail down the problem. Here we go.

<<< Start of Chat Session>>>

Balmukund: Hey.. Just came to office and saw your email. Are you ready to work now?
Friend: Hey Balmukund, Thanks for pinging back. I am ready to work now.

Balmukund: Are you able to connect the same SQL instance from other machines?
Friend: Never tried, let me try right now! (1 min pause) yes, I can.

Balmukund: Could you please share your desktop and let’s see what’s going on?
Friend: Sure!

Balmukund: Okay, I can see your desktop now. Show me the error again.
Friend: There you go! As you can see, I am unable to expand any node completely. It ends up in same error.

Balmukund: Could you please open “New Query” window?
Friend: Let me try as I never did that after seeing this error. (5 second pause). Ouch, another error!

clip_image002

Balmukund: Hmm.. Please highlight the windows and hit Ctrl + C on your keyboard and then paste in chat windows.
Friend: What that would do? Copy image?

Balmukund: No, copy the text of the message.
Friend: Wow. that’s interesting. Here it is

—————————
Microsoft SQL Server Management Studio
—————————
The filename, directory name, or volume label syntax is incorrect. (Exception from HRESULT: 0x8007007B)
—————————
OK
—————————

Balmukund: Thanks. This sounds interesting.
Friend: Really! What’s next?

Balmukund: Since you confirmed that the issue is happening with the specific machine and you are able to connect to same SQL instance via SSMS on other machine then the error is specific to this machine settings. Agree?
Friend: Absolutely.

Balmukund: Now, lets download process monitor and run that tool. Here is the link http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx or you can go to http://live.sysinternals.com and search for procmon to download exe directly.
Friend: Done. Let me run the tool now.

Balmukund: Yes please. Start the data capture, reproduce the error and stop data capture.
Friend: Okay. Done. The is a lot of information. How would you find problem with this?

Balmukund: Lets apply the filter for process name = ssms.exe using Filter in menu bar

clip_image003

Friend: Okay. that has bought down the information captured to only ssms.exe.

Balmukund: Do you see any access to path which is not valid? Do you see “Name Invalid” in Results column?
Friend: Nope.

Balmukund: Okay. Click on New query windows and get other error. Do you see it now?
Friend: Yes. Its trying to access the path “C:\Users\demouser\AppData\Local\Temp;x:\SQL”

Balmukund: Okay. Let me take a screenshot.
Friend: Sure. I am sure you are going to write a blog.

Balmukund: Yes, of course. I have found earlier that few have hit the same null error.

 
ProcMon_NameInvalid

Balmukund: It says temp in the path and also X drive. Do you have that drive?
Friend: No, its not there.

Balmukund: Okay. Could you please open command prompt and type “Set T” and show me the output?
Friend: Sure.

image

Balmukund: I think that explains the issue. TEMP path of your environment variable is incorrect. Can you please correct it?
Friend: Can you tell me steps to change?

Balmukund: Sure.  My Computer > Right Click > Properties. And then choose “Advanced”. Then click on “Environment Variables”

image

Balmukund: Now, change TMP and TEMP to valid location. On my machines its “%USERPROFILE%\AppData\Local\Temp”
Friend: Done.

Balmukund: Now, logoff and log back in.
Friend: Sure. Let me Try…

After 2 min….

Friend: You are the man!
Balmukund: I know <smiley>  Is that working now?

Friend: Of course, Yes!!!! Thanks a ton! You saved me from uninstalling SQL Management Studio.
Balmukund: Anytime! Glad I could help.

<<< End of Chat Session>>>

Later, I search on internet and found various peoples getting same error after installing few softwares. Hopefully this blog will help someone in the world! Here are the few items:
http://connect.microsoft.com/SQLServer/feedback/details/573771/value-cannot-be-null
http://social.msdn.microsoft.com/Forums/en/sqltools/thread/7e0287b3-cd37-408e-8145-4b9dba8c7811 
http://connect.microsoft.com/SQLServer/feedback/details/742857/ssms-studio-reports-value-cannot-be-null-when-attempting-to-copy-headers-with-no-rows

Hopefully this would help someone in the world.

Cheers,
Balmukund Lakhani
Twitter @blakhani

32 Responses to “Help: Getting error “Value cannot be null” while opening management studio. Which value?”

  1. Sahal Omer said

    Amazing sirji, enjoyed reading this post

  2. subu said

    Hi Balmukund,

    Applogies from my side i m posting my question here. and This is not right plance to ask this question, security reasons.. i doing the same

    We are planning to configure Nagios alerts in SQL Server 2008 R2 In Dabase Mirroring.

    Databe mirrioring was configured, db01 to db02 with witness server
    db01 fails db02 was become principal but these things we have get the alerts through nagious is there any way to do this task please help me.

    Thanks
    Subu.

  3. subu said

    Hi Balmukund,

    Thanks for your reply…

    yes when every DB01 down DB02 Become principal at that time we have to get alerts in Nagious.

    We have operations team they will monitor the alerts immidiatly they will intimate DBA people,

    For this i m was looking some scripts to get the alerts could you please sugget me here how i process.

    Tx

  4. @sqlchow said

    This should also happen when the drive containing the temp folder is full right? I noticed similar thing today in the morning and the C drive was full.

  5. Nice post, Balmukund!

  6. […] some unhelpful hints from other forums, I found the real solution/problem hidden in a post: My TEMP/TMP folder(s) didn’t […]

  7. Scott Olson said

    Dear Balmukund,
    I’m having the same issue RE: the top of this blog. I finally got admin rights to my machine and tried to use your example above but I was never having any problem with the query function. I’m having a problem with the DB’s showing up on the server I’m trying to access. I ran the Process Monitor and recieved over 12 processes that give me messages of File Name not found, Path not found, Buffer overflow, etc…I’m stumped and I’m not a server person. Our local IT reloaded the studio program…but the problem still exists. Can you help?

    • Scott Olson said

      sorry that’s 12,000 processes not 12 processes.

    • blakhani said

      What is the exact problem you are facing?

      • Scott Olson said

        Using MS SQL Server Manager, I’m supposed to be able to connect to another server in another region. I seem to be establishing the connection but when I go to select a Database I get the following error…Value cannot be null. Parameter name: viewInfo (Microsoft.sqpServer.Management.SqlStudio.Explorer).
        My local IT doesn’t have any understanding on how to fix this and the connection end point people say it’s a problem with my desktop computer. I tried using the Process Monitor but recieved over 12,000 processes that I have no idea what they mean. I’m leaving on vacation Saturday and really would like to get this fixed…any help is greatly appreciated! Thank you Scott

  8. Scott Olson said

    Hello again! I’m back from my vacation and was wondering if you knew anything about this situation or had any suggestions.
    Thank you!

  9. Manoj said

    1.Go to windows Run and search there name like %temp% .

    2.Below path will be opened on new windows.

    C:\Users\Administrator\AppData\Local\Temp

    3. Above path you have to create one folder & its name is 2. Like as below.
    C:\Users\Administrator\AppData\Local\Temp\2

    4. Now close the session of SQL server and start the Management studio.Your SQL will be work properly.

    I have resolved the said issues with my given 4 steps.

  10. AMAN ANKIT said

    Hello, Very interesting post.. It would be great if you post any blog related to CPU Utilization and capture the data using SQL Diag.

  11. Hi Balmukund,

    I have got the same error mentioned at the top. I am facing this while expanding the Database. I have come to know about this link while surfing for the solution toward my problem and found this interesting and near to what I am actually facing. I am able to work through “New Query” window. But not being able to see the registered databases and through expanding the databases. I was also facing some error like “Visual C# command line compiler has stopped working” pop up and the same mentioned above like it says “value cannot be null”. I have tried so many solution for this but could not fix the same.
    More over re-installation of sql also could not solve the issue.

    Using process monitior I got this “HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server\100\Tools\Shell\PollingInterval” and in the result column it says “Name Not Found”.

    Please help.

    I am looking forward to hear from you as a last hope.

    Thanks in advance for any help.

  12. Hi Balmukund,

    I have got the same error mentioned at the top. I am facing this while expanding the Database. I have come to know about this link while surfing for the solution toward my problem and found this interesting and near to what I am actually facing. I am able to work through “New Query” window. But not being able to see the registered databases and through expanding the databases. I was also facing some error like “Visual C# command line compiler has stopped working” pop up and the same mentioned above like it says “value cannot be null”. I have tried so many solution for this but could not fix the same.
    More over re-installation of sql also could not solve the issue.

    Using process monitior I got this “HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server\100\Tools\Shell\PollingInterval” and in the result column it says “Name Not Found”.

    Please help.

    I am looking forward to hear from you as a last hope.

    Thanks in advance for any help.

    • blakhani said

      Hi Vijay,
      1. Are you using any add-in into management studio?
      2. Are you able to connect to same server from different client without this problem?
      3. Do you see any error in System or Application Event Log?

      I am not sure if that key is the problem. Could you please tell me version of SQL Server Management Studio and SQL Server?

      • Hi Blakhani,

        Thanks for your quick assistance.

        Sorry to say I dint quite follow your 1st point but I am using SQL Express 2008 R2 on windows server 2008R2 and using SSMS I am doing that, for 2nd point :- yes it is working fine if connecting the same at remote machine.
        Regarding 3rd:- I could not find any thing there regarding this.

  13. Thanks for replying . I am using Sql Server 2008 R2 on window server 2008 R2. Earlier I was able to access the same from the remote sql means database’s were expanding without problem and it was working fine at that end but not working now after new installation, I mean not able to access the sql at remote now. I did not find any thing with application Event log.

  14. Hello @blakhani.. Thanks for your any help in advance if you can look into the issue please.

  15. rsmith said

    I had this exact same message but the temp variables were fine. I noticed repeated messages about low disk space and it turns out the space was so low that Windows would not permit the temporary files to be written. I just cleaned up the disk space and voila, everything worked fine.

  16. aman said

    Balmukund you the Man it also worked for me

  17. Kal Dyke said

    I have the same issue, I use sql server 2012. But since morning today, I cannot open the sql server management studio as it gives error message “Value cannot be null. Parameter name: name”. I have tried all the solutions you provided but none worked.

    Please what should I do, as i needed this resolved urgently.

    Thank you

  18. AJAY GARG said

    open services.msc >- check “sql server” >> if it is logon as network service.

    right click > go to properties >> click on “Log On” >> choose local system account.

    Thanks!

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.