Advertisements

Database Collation and trying to detect changes

–Test 1 If database collation is case insenstive and you are trying to detect changes on a column where only the case has changed, this will not detect

SELECT A.*

FROM (SELECT ‘SQLSERVERCASECOLLATIONTEST’ AS COLA,’COLLATIONA’ AS COLB) A

LEFT JOIN (SELECT ‘sqlservercasecollationtest’ AS COLA,’COLLATIONA’ AS COLB) B ON A.COLA=B.COLA

WHERE B.COLA IS NULL

–Test 2 If database collation is case insenstive and you are trying to detect changes on a column, this will detect

SELECT A.*

FROM (SELECT ‘SQLSERVERCASECOLLATIONTEST’ AS COLA,’COLLATIONA’ AS COLB,BINARY_CHECKSUM(‘SQLSERVERCASECOLLATIONTEST’,’COLLATIONA’) AS COLC ) A

LEFT JOIN (SELECT ‘sqlservercasecollationtest’ AS COLA,’COLLATIONA’ AS COLB,BINARY_CHECKSUM(‘sqlservercasecollationtest’,’COLLATIONA’) AS COLC ) B ON A.COLC=B.COLC

WHERE B.COLC IS NULL

Advertisements

error 32016 The specified agent_id %s or agent_type %d do not form a valid pair for log shipping monitoring processing

Buddy at work was smashing his brain against this error for a while, looks to be that the wizard that creates log shipping via SSMS has a bug, you need to edit the command of the Copy and Restore jobs so that the -server parameter is set to the secondary server name!

http://ms-dba.blogspot.com/2010/06/copy-and-restore-job-errors-with-log.html