Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

scripting in SQL Server

Status
Not open for further replies.

holdahl

IS-IT--Management
Apr 4, 2006
213
NO
I'm trying to make a backup-script which checks that yesterdays backup to tape was ok before doing todays backup.
this is to be done by checking that a flag-file does exist (is created if tape-backup was ok) and if so, then start todays backup.
any comments on whether to do this through SQL Server Management Studio (is this possible) or use something like Windows Power Shell to make this script?

-holdahl
 
I would use a SQL Server scheduled job in the SQL Agent.


- Paul
- If at first you don't succeed, find out if the loser gets anything.
 
If you can do this in SSMS / QA, then you can do it as a T-SQL job step in a SQL Server Job.

Or you could use an SSIS package, but that is probably overkill. @=)

HOWEVER, just because the file exists, doesn't mean the backup is a good one. If you really, truly want to verify that your backup file is a good one, code a RESTORE to a Sandbox server and then a DROP DATABASE. If the RESTORE doesn't fail, then the backup file is definitely good.



Catadmin - MCDBA, MCSA
"No, no. Yes. No, I tried that. Yes, both ways. No, I don't know. No again. Are there any more questions?"
-- Xena, "Been There, Done That"
 
so this kind of script can be done/made using SSMS?
is there any documents on doing this kind of stuff in SSMS?

-holdahl
 
Books Online is your best bet for documentation.

But the way you phrase your question makes me wonder, can you actually write T-SQL?

Please don't be offended. Like I said, I'm only asking because of the way you asked the SSMS question. Since SSMS is Enterprise Manager and Query Analyzer squished together, any coding you could do in QA you can pretty much do in SSMS except for some minor keyword changes. If you don't know how to do T-SQL, let us know and we can refer you to a bunch of good primers for learning the language.





Catadmin - MCDBA, MCSA
"No, no. Yes. No, I tried that. Yes, both ways. No, I don't know. No again. Are there any more questions?"
-- Xena, "Been There, Done That"
 
I dont' know that much t-sql, so please feel free to recommend some lecture/books about how to use it for more advanced tasks.

Have not been working with MS SQL that long.


-holdahl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top