title: How to select/update only same GUID from different tables
body: <p>In SQL Server I am trying to update specific column of a table when its GUID and another's are the same.</p>
  <pre><code> UPDATE [A].[Sch].[Box]
       SET [FFType_Id] = 5
   WHERE [A].[Sch].[Box].Id = (SELECT id from [B].Sch.Boxes)
  </code></pre>
  <p>I understand that GUID can't be compared and that's why I tried to <code>CAST()</code> or <code>CONVERT()</code></p>
  <pre><code>N''''+CONVERT(nvarchar(max),[B].Sch.Boxes.Id)+  N''''
  </code></pre>
  <p>and</p>
  <pre><code>CAST([B].Sch.Boxes.Id AS VARCHAR(MAX))
  </code></pre>
  <p>In addition when i query</p>
  <pre><code>SELECT [A].Sch.Box.Id, [B].Sch.Boxes.Id 
  FROM [A].Sch.Box INNER JOIN [B].Sch.Boxes 
                           ON [A].Sch.Box.Id = [B].Sch.Boxes.Id
                           WHERE [A].Sch.Box.Id= [B].Sch.Boxes.Id
  </code></pre>
  <p>it returns all ids (Same or note) but when i query</p>
  <pre><code>SELECT [A].Sch.Box.Id, [B].Sch.Boxes.Id 
  FROM [A].Sch.Box INNER JOIN [B].Sch.Boxes 
                           ON [A].Sch.Box.Id = [B].Sch.Boxes.Id
                           WHERE [A].Sch.Box.Id= '0DB2F38E-DE98-43B9-9333-8CD395506858'
  </code></pre>
  <p>It returns only that one</p>