title: Why can't I pass in a uniqueidentifier/GUID to a stored procedure
body: <p>I have this SP</p>
  
  <pre><code>USE [TestDB]
  GO
  /****** Object:  StoredProcedure [dbo].[sp_test]    Script Date: 06/12/2010 11:47:27 ******/
  SET ANSI_NULLS ON
  GO
  SET QUOTED_IDENTIFIER ON
  GO
  
  CREATE PROCEDURE [dbo].[sp_test]  
      @id uniqueidentifier
  AS
  BEGIN
  
      select * from TestTbl where ProductId= @id
  
  END
  </code></pre>
  
  <p>I then went to the SP with ms sql 2005 and clicked execute. It comes up with a box where I entered in the GUID. I copied and pasted it straight from my test database.</p>
  
  <p>I get this error.</p>
  
  <blockquote>
    <p>Msg 102, Level 15, State 1, Line 5
    Incorrect syntax near 'cac671b'.</p>
  </blockquote>
  
  <p>So why can't I sent in GUIDs? even ones that are copied right from the database and must be valid as they where allowed into the db.</p>