Thursday, January 23, 2014

Intellisense and SSMS

Intellisense in the Query Editor was a wonderful addition to SQL 2008.  I find myself using it even more with SQL 2012.  But as a programmer I just hate to see squiggly red lines under my objects, especially when I'm right and Intellisense is wrong.



This is a common occurrence when working on new database objects.  If you create a new table or column and then start writing a query against it, Intellisense will underline those objects and tell you they don't exist.  This is because Intellisense has a cache of objects that just isn't updated as frequently as we need it to be.

To manually refresh the cache and make those terrible squigglies go away, press the key combination CTRL-SHIFT-R.  You can also use the menu and select Edit -> IntelliSense -> Refresh Local Cache, but I've found this doesn't always resolve the issue right away.  The key combination while the query editor window has focus seems to always do the trick for me.

Wednesday, January 22, 2014

Insert Content from SharePoint

After upgrading from SharePoint 2007 to 2010, whenever we edited a web part page and tried to insert content (such as an image or video) and selected "From SharePoint" as the option, we got a pop up window with the basic SharePoint error information:

Unexpected Error
 
After some digging, it turns out this is related to the same issue that causes another feature to not work.  In Site Settings, clicking the Content and Structure link under Site Administration generated the same error message.  Now you can dig into the correlation data and try to understand why this sitemanager.aspx page isn't pulling up, but the problem is that you have a corrupted list or library somewhere on the site.
 
You can identify it (the hard way) by viewing all site content and clicking each list or library, and then viewing the Settings page for that object.  When you get to one that throws an error, that is the one you need to delete (SharePoint Designer to the rescue).  You may even get the error before you can click the Settings page. Once removed, your Site Manager page and Insert Content pages should work successfully.
 
Protip: Sometimes you can even recover the deleted list or library from the recycle bin without bringing back the errors!