title: How to call a stored procedure to populate one table from another in SQL Server?
body: <p>I am still new to SQL, so doing it by learning. I would like to populate a table using stored procedure. My question is how do I call the procedure so that it gets executed and the table gets populated. So far I have done this. </p>
  
  <pre><code>ALTER proc [dbo].[MytestTableLoad]
     @ID int,
     @FirstName varchar,
  As
  Begin
     Set nocount on;
  
     merge dbo.MytestTable2 as target
     using (select @ID, @FirstName,@LastName) as source (Id, FirstName, LastName)
     on (target.Id=source.Id)
     when not matched then
       Insert   (Id, FirstName, LastName)
       values (@Id, @FirstName,@LastName)
     ;
  END    
  </code></pre>