Friday 26 June 2015

How to schedule the SQL job for every last Sunday of month



I wrote the data purging script and tested across the environment. Now we need to schedule this job to run every last Sunday of the month. First thought was how is it possible? How the SQL Server will recognize that it’s last Sunday and etc.

When I did some R&D then I found the very easy way to do this. Let me step out here. I hope it will save your time.

  1. Right click on the job
  2. Select new job
  3. Select Schedule from left pan
  4. Click on New button
  5. Give the schedule name
  6. Choose monthly on occurs column
  7. Then choose ‘The’ radio button
  8. Then choose ‘Last’ and then ‘Sunday’

   How to change the default location of datafile logfile and backup file in SQL SERVER



It is very common mistake when we forget to change the default datafile logfile and backup location while installing SQL Server. Below the step you can follow to change the default file location properties.

  1. Open the management studio
  2. Connect to SQL Server instance
  3. Right click on instance and select properties
  4. You will get a dialog box. Select “Database Settings” from left pan.
  5. Change the new datafile logfile and backup file location in respective text box. Below is on screen shot