Implicit conversion of varchar value to varchar cannot be performed because the collation of the value is unresolved due to a collation conflict.

Problem:

I am trying to validate the codes in "Script to auto generate a security report for your SQL Server instance" by  on SQL Server 2008R2, I get an error:

Implicit conversion of varchar value to varchar cannot be performed because the collation of the value is unresolved due to a collation conflict.

Reason:

My server has a collation: Latin1_General_CI_AS
The Database context runs the code has a collation: Latin1_General_CP1_CI_AS

That causes the problem.

Solution:

Run the following code to make the DB collation in sync with the server collation. After that, it works!

USE Tempdb
GO

ALTER DATABASE (database name here) COLLATE (collation name here)
GO

Trying PSExec to access to SQL Server 2008+ if locked out

See the following article by Aaron Bertrand for background information on the PSExec utility.

http://www.mssqltips.com/sqlservertip/2682/recover-access-to-a-sql-server-instance/

The process to get back up and running is quite simple. Log in to the server where SQL Server is running, as an account with local Administrator privileges. Download and extract PsExec.exe (http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx). Run the command prompt (i.e., cmd) as an Administrator. Run the following command, adjusting for your actual path to Management Studio:

PsExec -s -i "C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\Ssms.exe". It worked!
(issuing the PsExec command from the right directory. In my case, it is: C:\Users\CK\Downloads\PSTools\PsExec -s -i.....)