Forum Replies Created

Viewing 11 posts - 1 through 11 (of 11 total)

  • RE: In Praise of Service Broker

    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...

  • RE: Simplify Large Queries with Temporary Tables, Table Variables and CTEs

    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...

  • RE: Clustered Index Analyser

    Everything worked well until the script encountered a partitioned table.

  • RE: Logging with SQL Server

    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...

  • RE: Index Fragmentation Status (includes Partitioned Tables/Indexes)

    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...

  • RE: Index Fragmentation Status (includes Partitioned Tables/Indexes)

    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

    ...

  • RE: Logging with SQL Server

    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 :...

  • RE: Logging with SQL Server

    Phillip - Texas (1/6/2010)


    Can anyone post a working code example of a Windows Service? I tried using the code in the article and had to play with it a bit...

  • RE: Logging with SQL Server

    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...

  • RE: Logging with SQL Server

    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

  • RE: Comparison of Dates in SQL

    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,...

Viewing 11 posts - 1 through 11 (of 11 total)