Link to home
Start Free TrialLog in
Avatar of Easwaran Paramasivam
Easwaran ParamasivamFlag for India

asked on

How to work with SQL Job?

Hi Experts,

  I would like to know how to create jobs in sql and how to run time at scheduled time recursively? Please do explain with example. Thanks.
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

you mean, in sql server agents folder?
I mean, what exactly is the problem?
Avatar of Easwaran Paramasivam

ASKER

I would like to create a backup script. I would like to run on every Monday morning 10 am using sql server jobs. How to achieve that?
Create a script sql and save it to a file with .sql
Execute it with task planified an sql agent :
script.slq :
UPDATE config 
	SET [valeur] = CONVERT(VARCHAR(24),GETDATE(),103) 
WHERE param = 'stat_vrp_date_derniere_modification'

Open in new window


run.vbs

sqlcmd -S server ip\SQLEXPRESS -U user -P password -i "d:\script.sql" , 1,true

Open in new window

manumd,
  I don't see how that can do what is requested here, so I presume it was intended for another question?


EaswaranP:
  to create a backup script, you create a maintenance plan, where you can configure all you need with the sql server's gui. you could also implement this from command line, but the maintenance plan's options are very suitable to do this without the hassle of doing it via command line.
If you want to do it manually with step by step you can do it using below screens in given link.....

http://www.dailycoding.com/Posts/step_by_step_guide_to_add_a_sql_job_in_sql_server_2005.aspx

if you want to add it using sql script you can perform it using below link..

http://msdn.microsoft.com/en-us/library/ms187910.aspx
Execute it with task planified an sql agent - How to achieve this? Please do explain the steps. Thanks.
ASKER CERTIFIED SOLUTION
Avatar of keyu
keyu
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It's an a example banane
Thanks.