title: restoring log files using tsql script
body: <p>Hi I have log  files in my c drive as databasename_yyyymmddhhmm.trn0 formate . We get 3 transaction log files every 30 minutes which ends with 0,1,2.<br>
  I'm using </p>
  
  <pre><code>Restore database [databasename]
  From disk=N 'c:\foldername\databasename_yyyymmddhhmm.trn0',
  Disk = N 'c:\foldername\databasename_yyyymmddhhmm.trn1',
  Disk= N 'c:\foldername\databasename_yyyymmddhhmm.trn2'
  With norecovery
  Go
  </code></pre>
  
  <p>To restore log files . But I want to make it continuous process for every 30 minutes where the file name changes every 30minutes with a timestamp 
  For example : databasename _201701260700.trn0
  After 30 minutes we get another file like databasename_201701260730.trn0
  So how can  I 'change my query' ,so that the i can run every 30minutes in sql server agent job  with change in the time stamp .</p>
  
  <p>Thanks in advance </p>