title: Error in Dynamic SQL SP
body: <p>I Have created a procedure which has code like this:</p>
  
  <pre><code>   Create PROCEDURE Sample( @ID INT )
  AS 
      BEGIN
      DECLARE @SQL NVARCHAR(max)
      DECLARE @SchemaName SYSNAME
      DECLARE @TableName SYSNAME
      DECLARE @DatabaseName SYSNAME
  
  
       SELECT  @SQL = 'Create Table ' + @DatabaseName + '.'
              + @SchemaName + '.' + @TableName
              + '_temp' + '('
      SELECT  @SQL = @SQL + 'ID int NOT NULL Primary Key, Name VarChar(10))'  
  </code></pre>
  
  <p>I Always get error as :</p>
  
  <p>Msg 102, Level 15, State 1, Line 77
  Incorrect syntax near ','.</p>
  
  <p>Can anyone help me on this?</p>