Friday, 19 July 2013

RESTORE cannot process database 'X' because it is in use by this session

When running a restore database query, I got the above error in SQL Management Studio. This was due to having the database 'X' selected in the dropdown list of databases, as suggested by the second part of the error message, which stated "It is recommended that the master database be used when performing this operation."

I changed the dropdown to another database 'Y' and was able to re-run the query without error.

Tuesday, 9 July 2013

Missing Context Menu on Item in Team Development for Sitecore (TDS)

I recently had a problem in which I tried to "get" items from Sitecore using TDS. The item I was trying to get had several immediate children; however, the get only fetched the top item. When I right-clicked it to try to delete, no context menu appeared. I checked the file system and found that the .item file did not physically exist, so I reloaded the Visual Studio solution. This removed the item from the Solution Explorer, but did not explain what had gone wrong.

I eventually discovered the issue was due to having an alias item of the same name at the same level in Sitecore. Once I'd renamed the alias, I could correctly get the item and all of its children.