Archive for October, 2015

Error converting data type varchar to uniqueidentifier

This seemed like a straight-forward issue, and it was, after I straightened out the curves. I had a simple logging mechanism, a SQL stored procedure something like this:

 @Message VARCHAR(500)
 INSERT INTO ErrorLog (Message, Id)
 VALUES (@Message, @Id)

And in a calling stored procedure:

EXEC LogError 'An invalid response was returned.', NEWID

Both stored procedures compiled just fine. However, when I attempted to log the message, I got the error

Error converting data type varchar to uniqueidentifier.

It turns out that just because my SP compiled fine didn’t mean it was actually going to work. Just using “NEWID” wasn’t enough. Instead, I had to modify my logging function to use a variable of type UNIQUEIDENTIFIER, like so:

SET @NewId = NEWID()
EXEC LogError 'An invalid response was returned.', @NewId

Leave a comment

SharePoint “Access is denied” error on installation

I was trying to set up a new SharePoint 2013 instance. After I entered my database and service account information, I would receive an error page that pointed to the log file. Inside the log file was a message like this:

An exception of type System.InvalidOperationException was thrown.  Additional exception information: An error occurred while getting information about the user SPFarm at server ScottServer.local: Access is denied

The problem was that I was logged into the machine as the local administrator. When I logged in with a domain account, all was well.

Leave a comment

Path too long message when publishing from Visual Studio

While attempting to publish a web app from Visual Studio 2013 to Azure, I ran across this message:

The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

Searching the Internet provided many possible solutions, most involved modifying the MSBuild settings. None of them worked, unfortunately.

What did work, though, was moving the file to a shorter directory. So instead of hosting my project in C:\Users\scott.stoecker\Documents\Visual Studio 2013\Projects\ScottsApp folder, I moved it to C:\Projects, and that worked great.

1 Comment