title: Way to copy row content to different table without having to type all the columns in SQL Server
body: <p>I have a table with some columns. For archive purposes I usually create second table that looks exactly the same but I add additional <code>Primary Key</code> and <code>Username/DateTime</code>. After every edit I call procedure that looks more or less like that:</p>
  
  <pre><code>CREATE PROCEDURE [dbo].[sto_archiwizujPodmiot]
      @varPodmiotID INT, @varUzytkownik NVARCHAR(50), @varUzytkownikData DATETIME
  AS
  BEGIN
      -- SET NOCOUNT ON added to prevent extra result sets from
      -- interfering with SELECT statements.
      SET NOCOUNT ON;
  
  INSERT INTO [dbo].[PodmiotyHistoria]
             ([PodmiotID]
             ,[PodmiotOsobaNazwisko]
             ,[PodmiotOsobaImie]
             ,[PodmiotUzytkownik]
             ,[PodmiotUzytkownikData])
   SELECT [PodmiotID]
        ,[PodmiotOsobaNazwisko]
        ,[PodmiotOsobaImie]
        ,@varUzytkownik
        ,@varUzytkownikData
    FROM [dbo].[Podmioty]
  WHERE [PodmiotID] = @varPodmiotID
  END
  </code></pre>
  
  <p>I create such procedure for every single table that I need to have archive for. For example if someone is going to edit some fields before the update happens I call this procedure. Problem is it's a bit of work to create this for every single table, not much but still. Is there a way to make more generalized procedure that would let me do the same but I could call it for every single table just by giving parameters like <code>TableName</code>, <code>ArchiveTableName</code>, <code>Username</code>, <code>DateTime</code> or it's what I am supposed to do every time ?</p>