Forum Replies Created

Viewing 15 posts - 1,411 through 1,425 (of 6,036 total)

  • RE: Logon trigger rejects connections when CPU use is high

    Try this trigger:

    CREATE TRIGGER RAC_logon_trigger

    ON ALL SERVER

    WITH

    EXECUTE AS 'sa'

    FOR LOGON

    ...

  • RE: Logon trigger rejects connections when CPU use is high

    It's also not such a bright idea to create a new object in tempdb on every logon.

    Get rid of @IP and replace it with a static table:

    1. Hardcoding parameters is...

  • RE: Logon trigger rejects connections when CPU use is high

    Why do you need all those horrible XML and dmv queries?

    SELECT @SessionId = @data.value ('(/EVENT_INSTANCE/SPID)[1]', 'int');

    SELECT @HostName = @data.value ('(/EVENT_INSTANCE/ClientHost)[1]', 'sysname');

    ...

  • RE: Need help on query performance

    ChrisM@home (5/26/2016)


    Using a clustered index like so:

    CREATE CLUSTERED INDEX [cx_Stuff] ON [dbo].[ann_events_Tech_Details]

    ([source] ASC, [start_time] ASC)

    Such clustered may be very good on query but it's gonna be a very high cost...

  • RE: Need help on query performance

    John Mitchell-245523 (5/26/2016)


    Sergiy (5/25/2016)


    And from looking at the overall design I can conclude the clustered index on ReportItem must be

    (report_id, flow_name, report_item) INCLUDE (source)

    Do you mean (report_id, flow_name, report_item,...

  • RE: Need help on query performance

    jc85 (5/26/2016)


    Sergiy (5/25/2016)


    If that one goes not so bad then incorporate it into the bigger one:

    SELECT dateadd(dd,0, datediff(dd,0,b.start_time)) as [date], b.source, b.lang, SUM(b.sel_test) Test, SUM(b.sel_test2) Test2

    FROM TechDetails b

    WHERE b.start_time...

  • RE: T-SQL: Dipslaying Data from a Previous Row

    SUM(-GL10111.CRDTAMNT + GL10111.DEBITAMT + PREV.PERDBLNC - GL10111.PERDBLNC) - ( GL10111.DEBITAMT - GL10111.CRDTAMNT )

    Something does not look right here.

  • RE: Help with performance on query

    There are 2 ways to go.

    1. Pay to a qualified SQL developer who knows about normalisation rules and tends to follow them to develop a new, proper database to support...

  • RE: Need help on query performance

    If that one goes not so bad then incorporate it into the bigger one:

    SELECT DT.date, (a.source + '-' + a.report_item) as report_item,

    SUM(CASE WHEN b.lang = 'EN' THEN CASE a.report_item WHEN...

  • RE: Need help on query performance

    How does this query perform?

    SELECT dateadd(dd,0, datediff(dd,0,b.start_time)) as [date], b.source, b.lang, SUM(b.sel_test) Test, SUM(b.sel_test2) Test2

    FROM TechDetails b

    WHERE b.start_time >= @StartDate

    AND b.start_time < dateadd(dd,0, datediff(dd,0,@EndDate)+1)

    GROUP BY dateadd (dd, 0,...

  • RE: Need help on query performance

    jc85 (5/25/2016)


    Thanks ChrisM@Work.

    The query took quite some time to complete.

    Additional info provided in case you need it.

    ann_events_Tech_Details

    [start_time] - clustered index

    [id] - Unique, non-clustered index (PK)

    ann_ReportItem

    [source] - non-clustered index

    [call_flow_name] -...

  • RE: Need help on query performance

    jc85 (5/24/2016)


    Both tables already have id set as their clustered index so I will drop [start_time].

    This is exactly the problem.

    Make both PK's non-clustered and create a new clustered index on...

  • RE: 24x7 availability with SQL Server 2012 Standard Edition

    Lynn Pettis (5/24/2016)


    I have to agree with Steve. I would also look at the indexes you have on the tables. If you have good clustered indexes that don't...

  • RE: Need help on query performance

    jc85 (5/24/2016)


    Added start_time as Non-clustered index for table ann_events_Tech_Details.

    Make it clustered.

    Otherwise - drop it, no use of it anyway.

    Added report_id, report_item, call_flow_name, source as Non-clustered index for table ann_ReportItem

    [Source] must...

  • RE: How to get output from a select to a file ?

    ben.brugman (5/19/2016)


    I do agree not allowing xp_cmdshell makes security tighter.

    There is simply no way to actually disallow xp_cmdshell.

    If you know one - please share it with us.

Viewing 15 posts - 1,411 through 1,425 (of 6,036 total)