Tag Info

New answers tagged

0

Yes you can achieve this with help of SP: CREATE PROCEDURE TestEmailOnFail AS BEGIN BEGIN TRY /* Perform some action that might fail */ SELECT 0/0; --THIS WILL FAIL END TRY BEGIN CATCH DECLARE @subject nvarchar(max) = 'Job Failure Notification'; DECLARE @body nvarchar(max) = 'TestEmailOnFail ...


0

Bearing in mind that PowerShell will be running under the Windows Account used to launch the SQL Agent service... there's a good chance that there's either a PowerShell prompt or a GUI prompt (e.g.: UAC) causing the process to never finish from SQL Agent's point of view. If SQL Server is running under the same Windows Account as SQL Agent then you could try ...


0

What you are telling is possible. A pseudo code would look like this : [ Make sure to use database compression and have instant file initialization enabled.] Check if it is first day of the month using select DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), 0) if it is first day of month, backup the previous month database to archive as ...


0

If you are looking to automate the process of backing up daily and automatically having the database restored onto the dev server from another location in the beginning of the month. I would look into BATCH files with SQL script exec statements. Then set up a windows task to run depending on the task (every 1st day of the month at 3am -- execute the restore ...


0

Well you can try to run a trace (if it's possible for you). But you can also try to just write it to your SQL Server Agent Job History instead. I tried to write a little bit of code which can be added as a first step in front of all other steps. It will simply write a line "Executed from [hostname]". I couldn't test it, due to the fact that I have just one ...



Top 50 recent answers are included