title: How do I format a url string to pass into stored procedure
body: <p>I created the below stored procedure in sql server that requires 3 parameters: Date, URL, &amp; Table Name:</p>
  <pre><code>ALTER PROCEDURE [stg].[usp_Delete_Data] 
      (@DateLookBack date,
       @siteUrl nvarchar(100), 
       @tableName SYSNAME)
  AS
  BEGIN
      SET QUOTED_IDENTIFIER ON
  
      SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
  
      DECLARE @sql NVARCHAR(MAX);
   
      SET @sql = N'DELETE FROM ' + CONCAT('[stg].[',@tableName,']') +
                  'WHERE date = ' + FORMAT(@DateLookBack, 'yyyyMMdd')  +
                  'AND siteUrl = ' + @siteUrl
  
      EXEC sp_executesql @Sql
  END
  </code></pre>
  <p>When I pass in a url, like 'https://stackoverflow.com', I get an error message:</p>
  <blockquote>
  <p>Incorrect syntax near 'https:'</p>
  </blockquote>
  <p>How do I format the url string so that it can pass into the query successfully?</p>