title: Truncate table then insert data into same table only inserts 1 record
body: <p>Does anyone know what i'm doing wrong here, I have a webpage that gets currency data from a remote source, I get the data and insert it into sql database via a stored procedure. If i put truncate in front of the insert statement, it truncates the table and inserts the last record.
  If i remove the truncate, it inserts all the records.</p>
  
  <p>i.e</p>
  
  <pre><code>truncate table tblTablename;
  
  insert into tblTablename
  (columns)
  values
  (data)
  </code></pre>
  
  <p>The above will insert the last record from 289 records.</p>
  
  <p>If i remove truncate all 289 records are inserted.</p>
  
  <p>I have tried using waitfor, for 1 second but that failed to work either. </p>
  
  <p>I'm not sure what else to do, so any help would be appreciated</p>
  
  <p>In webpage I have a foreach loop</p>
  
  <p>George</p>
  
  <p>/---------------------- SQL Code -----------------</p>
  
  <pre><code>  ALTER PROCEDURE [dbo].[atSP_InsertCurrency]
  -- Add the parameters for the stored procedure here
  @CurrencyCountry VarChar(150),
  @CurrencyRate VarChar(150),
  @UpdateSuccessFail  INT OUTPUT 
  AS
  BEGIN
  -- SET NOCOUNT ON added to prevent extra result sets from
  -- interfering with SELECT statements.
  SET NOCOUNT ON;
  TRUNCATE TABLE [dbo].[at_CurrencyRates];
  
  WAITFOR DELAY '000:00:01'
  
  
  INSERT INTO [dbo].[at_CurrencyRates]
  (
      [CurrencyCode],
      [CurrencyExchangeRate]
  )
  VALUES
  (
      @CurrencyCountry,
      @CurrencyRate
  )
  IF(@@ROWCOUNT &gt; 0)
      BEGIN
      select  @UpdateSuccessFail = '1'
      END
      ELSE
      BEGIN
      select  @UpdateSuccessFail = '0'
      END
  END
  </code></pre>