Viewing 11 posts - 1 through 11 (of 11 total)
Before using Service Broker (SB), we had over a dozen Windows Services on another machine scanning tables for data to be processed. Between each scan, they would sleep for a...
October 21, 2014 at 4:44 am
One thing that I have found that can cause a temporary table or table variable to perform better than a CTE is that you can create indexes on them. This...
August 9, 2011 at 6:02 am
Everything worked well until the script encountered a partitioned table.
July 14, 2011 at 4:52 am
Sorry, I haven't been paying a lot of attention.
The first thing I notice is that you have all of your code in the OnStart event handler. This won't work as...
December 17, 2010 at 5:28 pm
Being quite old and used to managing resources, I am always looking for ways to make what I do faster, better and easier to use. When I tried to run...
December 17, 2010 at 5:22 pm
I like the script but found it to be slow. I have mad a slight change and it is much faster:
;WITH IndexStats AS
(
select
object_id,
index_id,
partition_number,
Avg_Fragmentation_In_Percent,
Fragment_Count,
Avg_Fragment_Size_In_Pages,
Page_Count
from
sys.dm_db_index_physical_stats(DB_ID(), NULL, NULL , NULL, N'LIMITED')
)
SELECT
...
December 16, 2010 at 9:38 am
Regarding the user of a Windows Service, the following is the code that we use:
using System;
using System.ServiceProcess;
using System.Threading;
namespace ROAMLogService
{
public delegate void ThreadCallback ( string Message );
public partial class ROAMLogService :...
January 7, 2010 at 5:23 am
Phillip - Texas (1/6/2010)
January 6, 2010 at 2:21 pm
Yes, I could have done that, and thought about it. I wanted to separate the DB stuff from the OS stuff.
The issue of a failed transaction, however is something that...
January 6, 2010 at 9:35 am
My error.
I should have included the entire procedure:
CREATE PROCEDURE [dbo].[ProcessLogQueue]
AS
BEGIN
SET NOCOUNT ON;
BEGIN TRANSACTION
WAITFOR (RECEIVE TOP(1)
CONVERT (XML, CONVERT (varchar(MAX), message_body) )
FROM
LogTargetQueue)
COMMIT TRANSACTION
END
January 6, 2010 at 9:33 am
Using the DATEDIFF function works but can be very slow.
I prefer using:
DECLARE
@FromDate DATETIME,
@ThruDate DATETIME
SET @FromDate = CONVERT(VARCHAR, GETDATE(), 101) --mm/dd/yyyy 00:00:00.000
SET @ThruDate = DATEADD(DAY, 1, @FromDate)
SET @ThruDate = DATEADD(MS, -3,...
May 1, 2009 at 8:49 am
Viewing 11 posts - 1 through 11 (of 11 total)