Value cannot be null in 2008 R2 SSMS / Studio Package failed to load.

SSMS now gives me this error when I start it in 2008 R2 x64 on windows 7 x64 (possibly caused by installing windows live, or the latest windows security updates):

Additionally, I am unable to open any databases, or even see them in SSMS explorer.

(NOTE: Repair does NOT correct.)

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

Value cannot be null.
Parameter name: viewInfo (Microsoft.SqlServer.Management.SqlStudio.Explorer)

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

   at Microsoft.SqlServer.Management.SqlStudio.Explorer.ExplorerViewDescriptor..ctor(IFactoryService factoryService, INavigationViewInfo viewInfo, String urnPath, IDictionary`2 allEntities)
   at Microsoft.SqlServer.Management.SqlStudio.Explorer.NavigationService.GetView(String urnPath)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.<GetColumnsFromNavigationService>d__f.MoveNext()
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.AddFields(List`1 list, IEnumerable`1 fields, IDictionary`2 allValidFields, AddFieldsFlags flags)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.GetParentFields(INodeInformation source, Dictionary`2& allValidColumns)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.BuildDynamicItemWithQuery(IList`1 nodes, INodeInformation source, INavigableItem sourceItem, String urnQuery, Boolean registerBuilder, Boolean registerBuiltItems)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.BuildDynamicItem(IList`1 nodes, INodeInformation source, INavigableItem sourceItem, IFilterProvider filter)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.Build(IList`1 nodes, INodeInformation source, INavigableItem sourceItem, IFilterProvider filter)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItem.RequestChildren(IGetChildrenRequest request)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ExplorerHierarchyNode.BuildChildren(WaitHandle quitEvent)

 

  • Edited by TechVsLife2 Monday, October 18, 2010 12:21 AM
October 17th, 2010 3:46am

Whats the operation done in SSMS to get this error? I would put profiler and check the query being fired. There is some property which is not expected to be null but returned as null (such as database owner)
Free Windows Admin Tool Kit Click here and download it now
October 17th, 2010 5:38am

No query is being fired.  This is an error when starting SSMS.
October 17th, 2010 5:48am

even before connecting to SQL engine?

Free Windows Admin Tool Kit Click here and download it now
October 17th, 2010 6:10am

No, it's right after pressing "connect" in the dialog box that pops up whenever you start SSMS.  (I think it's an SSMS issue, not an engine issue, because no other program gives an error connecting, e.g. MS Access can connect and open up tables in the sql server database via odbc.)

Profiler doesn't seem to show anything of note, things look normal there--how would I check to see if nulls were returned. 

 

Note that profiler/tracer does NOT add any new listings when I navigate in ssms explorer and try to show any databases, including system databases, even though the same "value cannot be null" error is returned then by ssms. So it doesn't seem like a query or the engine is at issue. (Listings are added in profiler/tracer when I first open up SSMS only, but the same "value cannot be null" SSMS error is triggered when I try to browse in SSMS explorer.)
October 17th, 2010 6:21am

I also believe this is SSMS issue but may be specific to this instance. Other tools (MS Access, ODBC) fire different queries and they don't have same functionality as SSMS.

What happens if you use same SSMS to connect to other database engine (instance)? does that also show null error?

You are correct, one you hit connect, we would populate most of the 1st level nodes in SSMS. I would suggest you to take profiler trace and run those queries within the query and check if there is some thing unusual.

Is there any error on Err

Free Windows Admin Tool Kit Click here and download it now
October 17th, 2010 7:33am

I don't have any other instance of sql server installed.  I didn't see anything unusual in profiler, but not sure what would be unusual. 

There is no error in errorlog but there is no errorlog folder for 10.5 (r2); there is an errorlog folder for 10.0 which seems to update for 10.5, and the only thing that comes close there is this:
The SQL Server Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service. Error: 0x54b, state: 3. Failure to register an SPN may cause integrated authentication to fall back to NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies.

This looks related (where the workaround is to add permisssions for the user that installed sql server):
http://social.msdn.microsoft.com/Forums/en/sqltools/thread/2afbd7a3-a13a-4f7a-9bb0-917bccd4cbdb

However, adding full permissions for the current user (who installed sql server) made no difference, and I am not sure for whom else they want me to add permissions.

 

 

October 17th, 2010 4:19pm

When I run the text of the individual queries from profiler/tracer in the SSMS query window, there were no errors (and no nulls returned for any column), so the bug seems unrelated to any queries being sent.  Unfortunately, I can't use edit or use any databases in SSMS until this is resolved.

 

btw, the column "LogOnSuccess" for the query below (from tracer/profiler) returns a zero. (The computer name is "MYPCNAME"), but that is probably not an error (the computer is running as a local desktop, not as part of a domain). exec sp_executesql N'SELECT ''PolicyStore[@Name='' + quotename(CAST(serverproperty(N''Servername'') AS sysname),'''''''') + '']'' AS [Urn], CAST(serverproperty(N''Servername'') AS sysname) AS [Name], CAST( (SELECT current_value FROM msdb.dbo.syspolicy_configuration WHERE name = ''Enabled'') AS bit) AS [Enabled], CAST( (SELECT current_value FROM msdb.dbo.syspolicy_configuration WHERE name = ''HistoryRetentionInDays'') AS int) AS [HistoryRetentionInDays], CAST( (SELECT current_value FROM msdb.dbo.syspolicy_configuration WHERE name = ''LogOnSuccess'') AS bit) AS [LogOnSuccess] WHERE (CAST(serverproperty(N''Servername'') AS sysname)=@_msparam_0)',N'@_msparam_0 nvarchar(4000)',@_msparam_0=N'MYPCNAME'
Free Windows Admin Tool Kit Click here and download it now
October 17th, 2010 6:15pm

are you sure the build of SSMS is in sync with the engine you are trying to connect to?

If you are using an older build of SSMS and a newer server, you can get this kind of error.  

SSMS is usually backwards compatible (newer build of SSMS works against older server), but it's pretty much never forwards compatible (old build of SSMS and new server).

October 17th, 2010 6:48pm

I hope there's some other solution short of a reformat of the computer and reinstall of the os.

@jezemine:  It looks like they are in perfect sync, but let me know if there is some way of determining it other than this:

This is what I get in help about in SSMS:

Microsoft SQL Server Management Studio      10.50.1734.0
Microsoft Analysis Services Client Tools      10.50.1734.0
Microsoft Data Access Components (MDAC)      6.1.7600.16385
Microsoft MSXML      3.0 6.0
Microsoft Internet Explorer      8.0.7600.16385
Microsoft .NET Framework      2.0.50727.4952
Operating System      6.1.7600

This is what the query window returns for the engine:
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
Returns this:
10.50.1734.0 RTM Enterprise Edition (64-bit)

Free Windows Admin Tool Kit Click here and download it now
October 17th, 2010 7:13pm

So, your version seems newer, how and where did y
October 17th, 2010 9:37pm

I'm using the latest update to sql server R2, CU3.  But I doubt that's the cause of the problem, since I had that installed months ago and the problem with sql server began only this weekend. 

 

 

Free Windows Admin Tool Kit Click here and download it now
October 17th, 2010 10:46pm

UPDATE:
I uninstalled redgate utility tools (for sql server). 
Then I uninstalled CU3 (cumulative update), re-repaired sql 2008 R2 x64, and then tried running SSMS.
I also tried re-installing CU3, and then running SSMS.

The result in both cases is the same:
When I run SSMS, I now get two message information boxes, one after the other.
The first says:
Package 'Microsoft Sql Management Studio Package' failed to load. 
After pressing 'OK' (actually it's not 'ok,' but I don't get another choice):
The second one then pops up with the additional information that:
Package 'Microsoft Sql Management Studio Package' failed to load.

The first one has a yellow triangle containing a big black exclamation point.
The second one however has a red circle containing a big white X.
I'm sure that must have some significance.

Then the SSMS window abruptly shuts down.

(Is this progress?  Before this attempt, SSMS did stay open, now it closes on me after the message boxes.  However, the new error message is a change, and change is like hope.)

 

October 18th, 2010 12:19am

I don't know when precisely, but not more than a few days. unfortunately a windows restore rollback did not solve the problem.
Free Windows Admin Tool Kit Click here and download it now
October 18th, 2010 3:16am

It sounds to me you may be left to re-installing SQL Server from scratch :( First you'll need a clean un-install, then re-install.
October 18th, 2010 3:22am

Uninstalling and reinstalling sql server solved the problem.  Fortunately a "dirty" uninstall was enough: all I had to do was uninstall and reinstall SSMS only (not the engine or any other feature).  (I also reapplied CU3, but it worked even without CU3.)

  • Marked as answer by TechVsLife2 Monday, October 18, 2010 11:45 PM
Free Windows Admin Tool Kit Click here and download it now
October 18th, 2010 6:10am

I have the same problem ( "Value Cannot be Null Error" on SSMS 2008 R2 on x64 machine) .  It seems to be related to a SQL Server failure for one of my Registered Server Instances.  Now SSMS does not want to cooporate at all (show any database info).  I will try to reinstall SSMS.  Unless someone knows how I can unregister a server without being able to bring up Registered Servers under view Registered Servers.  The latter was giving me an error, now it just gives me a blank screen.

.

November 22nd, 2010 6:18pm

So i digged a little deeper and figured out it was a missing directory/file in %TEMP%. Seems some CleaningTool removes all files/directories in %Temp% and after that SSMS was not working any longer. The missing file is actually not needed, but the missing directory causes the "Value cannot be null" error.

My missing file name was:
C:\Users\<username>\AppData\Local\Temp\2\6vvdaozf.tmp
But the file name changes on every startup.
So my missing directory name was:
C:\Users\<username>\AppData\Local\Temp\2
After creating a empty directory with the name "2" in %TEMP% all went back to work fine for me.

I'm not sure the directory name is every time the same, but you can discover your missing file with the process monitor from Sysinternal Tools and filters to "Process Name is ssms.exe" and "Path contains AppData\Local\Temp"

Hope this helps other people to solve their issues too.
  • Proposed as answer by Naomi NEditor Wednesday, December 01, 2010 2:13 PM
  • Marked as answer by Naomi NEditor Tuesday, July 08, 2014 3:53 PM
Free Windows Admin Tool Kit Click here and download it now
December 1st, 2010 10:42am

I'm running Windows 7 and got same problem.

I've run SSMS as Administrator and everything worked fine.

 

PS I've gold rule of mine if you have any issues running any application on OS with UAC - use Run As Administrator.

December 14th, 2010 10:37pm

So i digged a little deeper and figured out it was a missing directory/file in %TEMP%. Seems some CleaningTool removes all files/directories in %Temp% and after that SSMS was not working any longer. The missing file is actually not needed, but the missing directory causes the "Value cannot be null" error.

My missing file name was:
C:\Users\<username>\AppData\Local\Temp\2\6vvdaozf.tmp
But the file name changes on every startup.
So my missing directory name was:
C:\Users\<username>\AppData\Local\Temp\2
After creating a empty directory with the name "2" in %TEMP% all went back to work fine for me.

I'm not sure the directory name is every time the same, but you can discover your missing file with the process monitor from Sysinternal Tools and filters to "Process Name is ssms.exe" and "Path contains AppData\Local\Temp"

Hope this helps other people to solve their issues too.

I had the same issue and adding the folder "2" resolved this for me. Thanks!
  • Proposed as answer by Naomi NEditor Thursday, April 26, 2012 3:35 PM
Free Windows Admin Tool Kit Click here and download it now
June 22nd, 2011 2:24pm

I looked eventlogs and C: disk was full. I cleaned. And problem was solved. that's all!
December 26th, 2011 8:21am

Hi,

Create empty directory with the name "2" in %TEMP% fix this problem for me too!

  • Proposed as answer by Naomi NEditor Thursday, April 26, 2012 3:35 PM
Free Windows Admin Tool Kit Click here and download it now
April 26th, 2012 1:45pm

Hi TechVsLife2,

Excuse my ignorance, new to SQL server. I had the same issue, but not sure what the actual error was, just wondering how to get those stack trace you had listed above.

Thanks in advance.

Regards,
SN

May 29th, 2012 3:15am

I followed your instructions and trust me... by Lords Name everything worked..... 

All you need to do is press the windows key + R, type in %TEMP%

create a new folder named "2" in the %TEMP% folder... 

Open SSMS...

Bingo that works fine... everything is back as normal... :) 

Free Windows Admin Tool Kit Click here and download it now
May 31st, 2012 11:37pm

I know I am late in the game but someone repoted same issue internally and I worked with him.

During troubleshooting we found that TEMP and TMP folders are pointing to invalid location. I have also added comment to connect item also.

<snip>

The most common cause of error would be %TEMP% and %TMP% are pointing to location which is not valid. If  you have SQL Server 2008 management studio on same machine, you would see below error.

The filename, directory name, or volume label syntax is incorrect. (Exception from HRESULT: 0x8007007B)

If you face same error, then make sure that start>run>%temp% and start>run>%tmp% are working fine. 

</snip>

http://connect.microsoft.com/SQLServer/feedback/details/573771/value-cannot-be-null

July 20th, 2012 6:55am

Hi,

I am running SSMS 2008 R2 on Windows 8. It worked all fine until a few days ago, when it stopped working. I now get "value can not be null" error.  I have

  • Checked that %TEMP% and %TMP% point to valid locations
  • Run it in admin mode
  • Created a folder name "2" in %TEMP%
  • Uninstalled & reinstalled SSMS

When I try to repair the installation I get the following error:

"Error 1316. A network error occurred while attempting to read from the time c:\058b0c84925255ea9000c2acecc8\1033_ENU_LP\x64\setup\SSCERuntime_x86-enu.msi"

The repair process then reports that the following steps failed:

  • Management Tools - Basic
  • Microsoft Sync Framework
  • SQL Compact Edition Runtime

The others were successful.

Free Windows Admin Tool Kit Click here and download it now
November 9th, 2012 2:09pm

Hi,

I had the same problem and i did the following:

goto to %appdata%\Microsoft\Microsoft SQL Server\100\Tools and rename Shell folder to Shell_1

goto C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\      or  C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG\

and backup machine.config  file

open machine.config and delete from <system.serviceModel> to </system.serviceModel> tag

execute Sql manager studio

Hope that works for you.

January 9th, 2013 9:25pm

Hi,

I have the similar when I did in-place upgrade of SQL Server 2005 SP3 to SQL Server 2008R2.

Go to C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\ and replace the machine.config with machine.config.default.

Good luck !

Free Windows Admin Tool Kit Click here and download it now
January 24th, 2013 3:47am

For me it was : empty space on C drive. Check that.
October 17th, 2013 6:18pm

Thanks its works
Free Windows Admin Tool Kit Click here and download it now
July 8th, 2014 8:24am

it worked for me by restarting the SQL server services

so i restart the service of the SQL instance 

March 18th, 2015 6:39am

https://connect.microsoft.com/SQLServer/feedback/details/573771/value-cannot-be-null
Free Windows Admin Tool Kit Click here and download it now
March 19th, 2015 3:36am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics