title: What's the best way to add double quotes in sql server 2000
body: <p>I have the following.</p>
  
  <pre class="lang-sql prettyprint-override"><code>SET QUOTED_IDENTIFIER ON 
  GO
  SET ANSI_NULLS ON 
  GO
  
  ALTER  FUNCTION doublequotestring(@str nvarchar(1998)) RETURNS nvarchar(4000) AS
  BEGIN
     DECLARE @ret nvarchar(4000),
             @sq  char(1)
     SELECT @sq = '"'
     SELECT @ret = replace(@str, @sq, @sq + @sq)
     RETURN(@sq + @ret + @sq)
  END
  
  GO
  SET QUOTED_IDENTIFIER OFF 
  GO
  SET ANSI_NULLS ON 
  GO
  </code></pre>
  
  <p>Is there another way?</p>