Forum Replies Created

Viewing 15 posts - 3,046 through 3,060 (of 10,144 total)

  • RE: SELECT clause

    gstarsaini (8/7/2014)


    Thanks for the reply.

    This means there is no effect on the queries?

    Each reply posted to your question implies "maybe", "probably" or "definitely". The average of these isn't "definitely not"!

  • RE: Display ALL rows even if no data exists

    pwalter83 (8/7/2014)


    ChrisM@Work (8/7/2014)


    This should get you started with Jeff's suggestion:

    SELECT *

    INTO #Offices

    FROM (VALUES

    ('KBE ANR','BELGIUM'),('KBE ZEE','BELGIUM'),('KEU ANR','BELGIUM'),

    ('KDE VIE','AUSTRIA'),

    ('KDE BRE','GERMANY'),('KDE BRV','GERMANY'),('KDE DUS','GERMANY'),('KDE FRA','GERMANY'),('KDE HAM','GERMANY'),('KDE MUC','GERMANY'),('KDE STR','GERMANY'),

    ('KFR BOD','FRANCE'),('KFR DKK','FRANCE'),('KFR FOS','FRANCE'),('KFR LEH','FRANCE'),('KFR...

  • RE: Help with query !!!

    Shadab Shah (8/7/2014)


    ChrisM@Work (8/7/2014)


    Should be easy enough - but as Lutz pointed out, which column will you use for the sequence? Without one, there's no concept of "earlier" or "later"....

  • RE: Display ALL rows even if no data exists

    This should get you started with Jeff's suggestion:

    SELECT *

    INTO #Offices

    FROM (VALUES

    ('KBE ANR','BELGIUM'),('KBE ZEE','BELGIUM'),('KEU ANR','BELGIUM'),

    ('KDE VIE','AUSTRIA'),

    ('KDE BRE','GERMANY'),('KDE BRV','GERMANY'),('KDE DUS','GERMANY'),('KDE FRA','GERMANY'),('KDE HAM','GERMANY'),('KDE MUC','GERMANY'),('KDE STR','GERMANY'),

    ('KFR BOD','FRANCE'),('KFR DKK','FRANCE'),('KFR FOS','FRANCE'),('KFR LEH','FRANCE'),('KFR LIO','FRANCE'),('KFR MRS','FRANCE'),

    ('KFR...

  • RE: handled NA values after'-' symbol in sql server

    If you set up your sample data as CREATE TABLE ... followed by INSERT to populate it, I'm sure your problem will be solved in minutes.

  • RE: Help with query !!!

    Should be easy enough - but as Lutz pointed out, which column will you use for the sequence? Without one, there's no concept of "earlier" or "later". Did you miss...

  • RE: Are the posted questions getting worse?

    A good friend of mine lived with colitis for 20 years and endured enough colonoscopies to feel like an inside-out Kate Moss, along with an assortment of drugs - many...

  • RE: Odd plan differences betwen LEFT JOIN and NOT EXISTS on insert

    You can read about per-row and per-index updates in this article by Paul White.

    I'll take a wild-ish guess and suggest that if you refresh statistics on tblPersonOtherAttribute, the plans for...

  • RE: Help with query !!!

    ;WITH SequencedData AS (SELECT Seq = ROW_NUMBER() OVER(ORDER BY (SELECT NULL)), * FROM #TEMP)

    SELECT t.PlayerName, t.DismissFormat, x.StrickRate

    FROM SequencedData t

    OUTER APPLY (

    SELECT TOP 1 StrickRate

    FROM SequencedData ti

    WHERE ti.PlayerName...

  • RE: Query Tuning Index question

    Kwisatz78 (8/6/2014)


    Yes I have raised this but its Microsoft Dynamics AX and without a lot of customisation to the way AX uses X++ to generate the SQL then unfortunately its...

  • RE: Query Tuning Index question

    With so much repetition of columns in the output, isn't index refactoring a little "cart before the horse"? I'd recommend you eliminate duplicated data from the output before considering indexing....

  • RE: Tuning a query that takes 60 minutes to run,

    -- The plan doesn't seem to work at all well with the actual rowcounts, probably due to out-of-date stats as others have suggested.

    -- You can probably eliminate the 500million row...

  • RE: COALESCE to replace multiple CASE statements

    MMartin1 (8/1/2014)

    .

    .

    .

    Its quite clear that a csv column is not only not normalised, but given the leading % in the search condition (doing a LIKE '%someTerm%' search) will create a...

  • RE: SQL procedure Query Performance issue

    ScottPletcher (8/1/2014)


    OPENQUERY does not allow variables, only literal/static queries.

    Try code below instead.

    --temporarily add "TOP (100)" to the query for testing purposes

    SET @tsql = STUFF(@tsql, CHARINDEX('SELECT', @tsql) + 6, 0, '...

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

    Use the one which is working.

    If this answer is insufficient, please make your question more clear. What are you trying to do? What are you trying to ask?

Viewing 15 posts - 3,046 through 3,060 (of 10,144 total)