title: Dynamic sql stored procedure update query issue?
body: <p>I've written the below code to set filepath column in my table as <code>'F:\DataMigration\Wise\DELTA_20121008\Attachments\SR\SR_1.txt'</code> </p>
  
  <pre><code>where SR_1 is file_name column
        .txt is file_ext column from my table.
  </code></pre>
  
  <p>but after executing following procedure, I'm getting filepath column in table as </p>
  
  <pre><code>'F:\DataMigration\Wise\DELTA_20121008\Attachments\file_name.file_ext'
  </code></pre>
  
  <p>means It's treating column names as string, how i can make it as column so it will
  use values in that column.</p>
  
  <pre><code>alter procedure [dbo].[WISEMissingAttachmentReportGenerator]
  (
  @tablename varchar(255), @pathonlocal nvarchar(255)
  )
  as
  begin
  --step 1
  exec dbo.proc_alter_table @tablename
  --step 2
  EXEC ('update '+ @tablename +
  ' set filepath = '''+ @pathonlocal + ' file_name'+'.'+'file_ext''')
  EXEC('Select * from '+@tablename)
  end
  
  exec [dbo].[WISEMissingAttachmentReportGenerator] [WISE.Non_VP_Service_Request_Attachments_File_Check_Analysis],
  N'F:\DataMigration\Wise\DELTA_20121008\Attachments\SR\'
  </code></pre>