Viewing 15 posts - 136 through 150 (of 486 total)
ajay.g (6/30/2015)
At Application level,...
June 30, 2015 at 7:42 am
Code to start a job on a remote server:
sqlcmd -SDBSERVER -E -Q"EXEC msdb..sp_start_job @job_name = 'Run RestoreDB'"
Code to check if the remote job has finished:
sqlcmd -SDBSERVER -E -i D:\Scripts\CHECK_Finished.sql
Contents of...
June 23, 2015 at 10:10 am
When using sp_startjob its an asynchronus call, so it wont wait till the job is finished. The way I get round this when only using a SQL...
June 23, 2015 at 10:05 am
I can't take credit for the function. I had that in useful scripts stored on my machine. But its definitely from a blog online.
The rest was me though...
June 23, 2015 at 7:39 am
I think this should do it, it also addresses the point Jeff made about gaps in the sequence.
CREATE FUNCTION [dbo].[CalculateNumberOFWorkDays] (@StartDate datetime, @EndDate datetime)
RETURNS int
AS
BEGIN
...
June 23, 2015 at 2:59 am
How about this:
SELECTnewer.MRN,
newer.EncDTTM,
newer.Sequence,
DATEDIFF(day,older.EncDTTM, newer.EncDTTM) as DaysApart
FROM TEST as newer
LEFT JOIN TEST As older
on newer.MRN = older.MRN
and newer.sequence = older.sequence + 1
ORDER BY newer.MRN, newer.EncDTTM DESC
June 22, 2015 at 5:23 am
Here is some good guidance on how to emulate job activity monitor programmatically:
http://www.sqlmatters.com/Articles/Checking%20the%20status%20of%20SQL%20Server%20Agent%20jobs.aspx
The undocumented procedure xp_sqlagent_enum_jobs can give you out the result set that you can manipulate.
May 28, 2015 at 7:40 am
A few questions:
1. Ballpark how many transaction log backups are you restoring to get your database up to date?
2. How big are these transaction log backup files?
3. ...
May 27, 2015 at 8:47 am
To give you a start here is one way to do it when storing in a table:
-- Create a table to store your fragmentation details
USE TEMPDB
GO
IF NOT EXISTS (SELECT TOP...
May 20, 2015 at 5:00 am
As mentioned already save the results in a table, but add a time stamp column for when the measurement was captured, you can then compare the rows based on the...
May 20, 2015 at 4:30 am
How about like this with a formatted table embedded in the body of the email:
DECLARE @ResponseAddress nvarchar(100),
@htmltext nvarchar(max),
@title nvarchar(256)
SET @ResponseAddress = 'email@email.com'
-- Create the HTML Text for the body of...
May 19, 2015 at 7:49 am
Its all covered here in msdn:
May 13, 2015 at 6:19 am
tcronin 95651 (5/5/2015)
May 13, 2015 at 6:16 am
Not really, you can run the other DBCC commands that make up DBCC CHECKDB independently though, overall it wouldn't save you any time:
May 13, 2015 at 6:02 am
Viewing 15 posts - 136 through 150 (of 486 total)