sql server 2008 - SQL Job: How to start with? -


can me create sql job in sql server agent (sql 2008) ,which run in purticular time interval(ex: daily) , select records table status=1 (select name,age student)and pass stored procedure accepts student name , age

here approach take:

create script

  • create sql script cursor in (the reason cursor because passing student name , age different stored procedure)
  • read studentname , age @variables
  • execute stored proc appropriate parameters
  • fetch next row , loop
  • imp: test script

save script in sql file further reference.

in sql server agent

  • create new job
  • point appropriate database
  • paste sql script (from above) script area of job
  • create appropriate schedule (daily, @ 3:15 am)
  • if operators , sql mail setup, add can email notifications
  • save job
  • imp: test job

Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -