SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Database Backup
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

yadhu_cse
Constraint Violating Yak Guru

India
252 Posts

Posted - 12/01/2010 :  02:18:54  Show Profile  Reply with Quote
hi,
can anybody tel me how to use windows 7 task scheduler for backingup database and make it run automaticaly

Kristen
Test

United Kingdom
22415 Posts

Posted - 12/01/2010 :  04:11:30  Show Profile  Reply with Quote
Use SQL Agent instead. That has scheduler and will run SQL commands / jobs.
Go to Top of Page

nigelrivett
Flowing Fount of Yak Knowledge

United Kingdom
3383 Posts

Posted - 12/01/2010 :  04:46:06  Show Profile  Visit nigelrivett's Homepage  Reply with Quote
You could use sqlcmd to execute a backup statement - but as Kristen says ....

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

yadhu_cse
Constraint Violating Yak Guru

India
252 Posts

Posted - 12/01/2010 :  05:04:15  Show Profile  Reply with Quote
ok.but v dnt have sql agent in express
Go to Top of Page

nigelrivett
Flowing Fount of Yak Knowledge

United Kingdom
3383 Posts

Posted - 12/01/2010 :  05:17:04  Show Profile  Visit nigelrivett's Homepage  Reply with Quote
There is a solution to use the broker to schedule jobs in express - do a search.
But using sqlcmd from the windows scheduler should work.

something like
sqlcmd -Smyserver -E -Q"backup database mydb to disk='c:\mydb.bak'"

oops - was sqlcmd available for v2005?
osql was very similar and was replaced by sqlcmd.


==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.

Edited by - nigelrivett on 12/01/2010 05:26:14
Go to Top of Page

yadhu_cse
Constraint Violating Yak Guru

India
252 Posts

Posted - 12/01/2010 :  05:28:51  Show Profile  Reply with Quote
i wrote sp to take back up but dn5 knw how to use it to schedule in task schedule
Go to Top of Page

nigelrivett
Flowing Fount of Yak Knowledge

United Kingdom
3383 Posts

Posted - 12/01/2010 :  05:41:11  Show Profile  Visit nigelrivett's Homepage  Reply with Quote
Use sqlcmd or osql to call it
I've checked and sqlcmd was available in v2005 so
sqlcmd -Smyserver -E -Q"exec mydb..s_MyBackup"

The -E means to use a trusted connection. It may need to be changed to a sql server connection depending on how the windows scheduler uns it but that's easy to set up.



==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

yadhu_cse
Constraint Violating Yak Guru

India
252 Posts

Posted - 12/01/2010 :  06:07:34  Show Profile  Reply with Quote
K thanks i will seethis
Go to Top of Page

Kristen
Test

United Kingdom
22415 Posts

Posted - 12/01/2010 :  09:54:42  Show Profile  Reply with Quote
"but v dnt have sql agent in express"

Not included as standard, but available to download AFAIK. **much** easier than trying to do it from Windows Task Manager
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.38 seconds. Powered By: Snitz Forums 2000