Forum Replies Created

Viewing 15 posts - 3,076 through 3,090 (of 10,144 total)

  • RE: SQL procedure Query Performance issue

    The easiest solution would be to save the query as a view on server ENIQSQLSERVER.

  • RE: How this works?

    vignesh.ms (7/24/2014)


    Hi there ,

    I got this code from web, I cant understand how it works

    can anybody suggest me with links or explanations about the below used techniques.

    .

    .

    .

    An...

  • RE: How this works?

    -- make a table with two rows, two columns

    DECLARE @t TABLE( ID INT IDENTITY, data VARCHAR(20))

    INSERT INTO @t(data) SELECT 'Jacob'

    INSERT INTO @t(data) SELECT 'Sebastian'

    SELECT * FROM @t

    GO

    ----------------------------------------------------------------------------------------------------

    DECLARE @t TABLE(...

  • RE: SQL procedure Query Performance issue

    mallikachowdhary 98955 (7/24/2014)


    Thanks Craig and Chris for the reply,

    I have run the query on both the servers will post the execution plan once it runs, normally when running the same...

  • RE: SQL procedure Query Performance issue

    Compare the execution plans. Since the queries take so long to run, begin with the estimated execution plan. They will highlight differences between the two servers - say an index...

  • RE: Below Update statement is not working! any Idea why

    Check how many rows match:

    SELECT a.dataid, x.Value

    FROM TableA a

    CROSS APPLY (

    SELECT TOP 1 t.Value

    FROM #tmpcopylibrary t

    WHERE t.dataid = a.dataid

    ORDER BY (SELECT NULL)

    ) x

  • RE: Display Duplicates

    TomThomson (7/23/2014)


    Brandie Tarvin (7/23/2014)


    ChrisM@Work (7/23/2014)


    At a guess, you have 741 duplicated rows, 73 triplicated, and 1 quadruplicated.

    Give the man a cookie for doing the actual math work! 😀

    No, he didn't...

  • RE: Display Duplicates

    At a guess, you have 741 duplicated rows, 73 triplicated, and 1 quadruplicated.

  • RE: Please help me debug this SQL

    -- Some alternative date arithmetic

    SELECT

    o.Forecasted_Commencement_Renewal_Date__c,

    CAST(RTRIM(CAST(MONTH(DATEADD(mm, 1, o.Forecasted_Commencement_Renewal_Date__c)) AS CHAR(2))) + '/01/' + CAST(YEAR(o.Forecasted_Commencement_Renewal_Date__c) AS CHAR(4)) AS DATETIME),

    DATEADD(MONTH,DATEDIFF(MONTH,0,Forecasted_Commencement_Renewal_Date__c)+1,0),

    CAST((CAST(YEAR(GETDATE()) AS CHAR(4)) + CASE WHEN LEN(CAST(MONTH(GETDATE()) AS CHAR(2))) < 2 THEN...

  • RE: Insert sequence number

    wBob (7/23/2014)


    I did trial that and honestly there is not a lot in it, with solution 1 (mine) slightly faster 5-10% on average at scale of 1 million. My...

  • RE: Difference in Time for same query

    Your first post shows Q1 and Q2 to be identical. If they are not, and you're obfuscating the code, then:

    1. Why are you expecting them to execute in the same...

  • RE: Insert sequence number

    Lynn Pettis (7/22/2014)


    ChrisM@home (7/22/2014)


    @wBob, you might find a TOP() -limited IBG-style inline tally even more efficient.

    Sort of like this:

    IF OBJECT_ID('dbo.numbers') IS NULL

    BEGIN

    CREATE TABLE dbo.numbers ( x INT, CONSTRAINT PK_numbers PRIMARY...

  • RE: Index grows really fast!

    murnilim9 (7/22/2014)


    ChrisM@Work (7/22/2014)


    -- change the index to support a nested loops join between rs and r

    -- with seeks to r on id and residual predicate of RNT and Man:

    create...

  • RE: Insert sequence number

    -- Make some sample data

    DROP TABLE #SampleTable

    SELECT *

    INTO #SampleTable

    FROM (

    SELECT TOP 17 [Claim number] = 111, [sequence number] = ROW_NUMBER() OVER(ORDER BY (SELECT NULL)) FROM SYSCOLUMNS

    UNION ALL

    SELECT TOP 38 [Claim...

Viewing 15 posts - 3,076 through 3,090 (of 10,144 total)