Forum Replies Created

Viewing 15 posts - 3,376 through 3,390 (of 10,144 total)

  • RE: Are the posted questions getting worse?

    DBCC TIMEWARP?

    I was tempted to suggest that only IBG and Jeff's queries can run that fast. Also, that queries running that fast can overheat the processor and should be slowed...

  • RE: Slow self join

    Bouke Bruinsma (5/6/2014)


    ChrisM@home (5/6/2014)


    Without sample data to test against...

    Try this.

    ;WITH Updater AS (

    SELECT

    FTEHrsAVG,

    NewFTEHrsAVG = AVG(CASE WHEN FlexVast = 'VAST' THEN FTEHrs ELSE NULL END)

    ...

  • RE: Why is this fast query slow in Visual Studio

    Begin by eliminating the obvious differences - your parameters are different datatypes between the two environments. The datatype of your parameters should match the datatype of the table columns wherever...

  • RE: Hanging WHILE loop

    WHILE affects only the statement immediately afterwards. If this statement is a batch defined by BEGIN and END, then the statements in the batch will be processed until the WHILE...

  • RE: forming a dynamic query

    Jeff Moden (5/6/2014)


    Sean Lange (5/1/2014)


    The first and the biggest issue is this is wide open to sql injection.

    In most cases, I'd strongly agree with you but... with two DATE, one...

  • RE: TSQL dilemma

    Variation on David's;

    DROP TABLE #Sample;

    CREATE TABLE #Sample (a INT, b INT, c INT);

    INSERT INTO #Sample (a, b, c)

    SELECT * FROM (VALUES (12345, 10000, 1),

    (12345, 10000, 2),

    (12345, 10000, 3),

    (12345, 10001, 1),

    (12346,...

  • RE: Help Needed in Complex Logic

    Sean Lange (5/6/2014)


    ChrisM@Work (5/6/2014)


    PIVOT / UNPIVOT haven't been told about the output column limitation of SELECT. Here's how to get 10,001 output columns from a SELECT:

    DROP table #Sample

    Create table #Sample...

  • RE: Help Needed in Complex Logic

    PIVOT / UNPIVOT haven't been told about the output column limitation of SELECT. Here's how to get 10,001 output columns from a SELECT:

    DROP table #Sample

    Create table #Sample (Empid int primary...

  • RE: Help Needed in Complex Logic

    ChrisM@Work (5/6/2014)


    KGJ-Dev (5/6/2014)


    thank you and am aware of this limitation. Is it possible to give me the dynamic query? i am planing to retrieve first 10000 rows for testing.

    10,000...

  • RE: Help Needed in Complex Logic

    KGJ-Dev (5/6/2014)


    thank you and am aware of this limitation. Is it possible to give me the dynamic query? i am planing to retrieve first 10000 rows for testing.

    10,000 rows...

  • RE: TSQL dilemma

    It won't need a genius, only a decent explanation. Perhaps a model would help. Try tinkering with this for starters:

    SELECT [identifying field], A, B, C,

    MAX(B) OVER(PARTITION BY [identifying field]),

    CASE WHEN...

  • RE: Help!!!

    saifmahatab (5/5/2014)


    Thanks but its not working..I tried I need to create a temp table where it stores the timing of a select query that I have takes time to run

    Sean's...

  • RE: Werid Behaviour of TSQL

    psingla (5/6/2014)


    I have complex view and try to fetch data from it.

    In following code query 2 takes 1 sec to execute and query 1 keeps on running for hours.

    I tried...

  • RE: SQL Server Read ismore

    yuvipoy (5/5/2014)


    yuvipoy (4/22/2014)


    After doing the recommendation i now see that the query is using index seek with 84%.

    So my question is index seek is better than index scan

    previously my query...

  • RE: forming a dynamic query

    You have three options: dynamic sql, a catch-all query, or using IF blocks to test the parameters and run whichever query fits the parameters.

    Catch-all queries are popular but come...

Viewing 15 posts - 3,376 through 3,390 (of 10,144 total)