title: Conversion failed when converting the nvarchar value '' to data type int
body: <p>While this may sound like a beginner 101 problem I think it is a bit more complicated.</p>
  
  <p>I have two instances of SQL server, one is a log-shipped read/only standby copy of the master database that is used for reporting purposes.</p>
  
  <p>They are both 64-bit SQL 2005, SP3.</p>
  
  <p>The LogShipped Instance is: 9.00.4035.00 (Standard Edition)
  The Original Instance is: 9.00.4035.00 (Enterprise Edition) in an Active / Passive Cluster.</p>
  
  <p>Server collation is Latin1_General_CI_AI on both and they both run on Server 2003 64 bit.</p>
  
  <p>I have a query that runs and executes fine on the master database server but it fails on the standby / read-only copy with a conversion of nvarchar to int.</p>
  
  <p>The code is identical and i've copied and pasted it from the main instance query window just to double check.</p>
  
  <p>Is there a bug in SQL server somewhere? I can paste the query if needed (its a bog-standard select with some in-line tables)</p>
  
  <p>Just don't understand why it works on the one yet the log-shipped copy fails.</p>
  
  <p>Any pointers is much appreciated.</p>
  
  <p>-- Edit</p>
  
  <p>I have found the culprit.. the transaction log database contains invalid data that isn't in the primary database.. quite why they are out of sych I do not know yet as the transaction log shipping is still working and I have no errors in the job-history.</p>
  
  <p>Just a few orphaned records that are invalid that are not in the primary db.. how odd</p>