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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trigger advice

Status
Not open for further replies.

Bell1991

Programmer
Aug 20, 2003
386
US
I am extremly new to SQL Server and i am currently reading about triggers - i was wondering if i could write a trigger to back up my database (i.e., backup every night at 12). Is that possible?

Also, one final question. How do you get the server date and time - when i insert a new row - i want to also insert the database time and date.

Thanks in advance for your help.
 
To backup your db use scheduled jobs or maintenance plan.

To retrieve datetime use the getdate() function
 
And set the getdate() function as the default value rather than putting it in a trigger, that is the more efficient way.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top