469,343 Members | 5,615 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,343 developers. It's quick & easy.

Job Schdule in MS SQL

3
Hi guys..I am new to MS SQL. .How can I schedule a job to do the following job :

1) schedule everyday at 1.00 am run
2) export yesterday data from a table A to another SQL server's table B as backup. (in that table A and B there is a date+time field when the live data created)

Thanks guys
Aug 15 '07 #1
5 1319
Purple
404 Expert 256MB
Hi jhwong and welcome to TSDN,

Can you confirm the version of MSSQL you are running ? 2000 / 2005 ?

Regards Purple
Aug 15 '07 #2
jhwong
3
Hi Purple,

I am using MSSQL 2000.
Aug 15 '07 #3
Purple
404 Expert 256MB
Hi,

If you have access to enterprise manager, expand your server, expand management, expand SQL server agent, click into jobs, right click to setup new job and complete the details.. If you wrap the sql you want to schedule in a stored procedure, you can then select it in these panels.

Regards Purple
Aug 15 '07 #4
jhwong
3
Hi Purple,

How can I select only those "yesterday" data and export it? is there any date function I can use in my query?

Thanks

Regards,
wong
Aug 16 '07 #5
Purple
404 Expert 256MB
Hi,

Expand|Select|Wrap|Line Numbers
  1. GETDATE() - 1
will give you yesterday's date.

Regards Purple
Aug 16 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

By using this site, you agree to our Privacy Policy and Terms of Use.