title: Does this SQL code run procedurally?
body: <p>I am trying to generate a batch of separate reports and rename them. Some of the reports are being given a name of the following report, other reports are being generated twice.</p>
  
  <p>Will this section of SQL code run line by line like it would in a procedural language?</p>
  
  <pre><code>        BEGIN
              --Execute the report
              EXEC ReportServer.dbo.AddEvent @EventType='TimedSubscription', @EventData=  'eca9df5f-270b-4460-a912-360cfd73a476';
              WAITFOR DELAY '00:00:10';
              -- Update processed_reports table once SSRS has executed
              UPDATE [ARCHIVER].[dbo].[test_processed_reports] 
              SET [test_processed_reports].[report_status] = 'processed', [test_processed_reports].[time_stamp] = GETDATE()
              WHERE batch_serial_no = @batch_counter 
              WAITFOR DELAY '00:00:02';
              -- Rename reports
              EXEC [dbo].[sp_ReplaceFileOrDirNames] @batch_counter,'C:\Reports' ,'Main_Report.pdf';
              WAITFOR DELAY '00:00:02';           
          END 
  </code></pre>
  
  <p>For example will it: Execute the ReportServer job, Wait for 10secs, Update the table of processed reports, wait for 2secs, then rename the report and then wait for 2secs.</p>