Forum Replies Created

Viewing 15 posts - 886 through 900 (of 1,825 total)

  • RE: A tale of two query plans

    Try This as your view definition...

    CREATE VIEW [PM].[vw_PatInfoData]

    AS

    SELECT

    Patient_ID,

    min(Case when Entry_Sequence= 1 then INFO1.Field_Value else Null end)AS Field1,

    min(Case when Entry_Sequence= 2 then INFO1.Field_Value else Null end )AS Field2,

    min(Case when Entry_Sequence= 3...

  • RE: A tale of two query plans

    Whats the Patient_info_field table ? Its table scanning , is there no indexes on that ?

    Can you post the view definition to ?

  • RE: A tale of two query plans

    Hmm the Optimizer is timing out. Reason for early Termination = "Time Out".

    If you remove the view does it execute ok ?

    Try an outer apply to the view.

    --Tried to...

  • RE: IF getdate() not working

    GetDate() contains a time portion to , you will need to account for that in your comparison

  • RE: Replication issue from US to Korean server

    I try to run a query remotely to that server.It sometimes runs well but then often I get an Transport level error

    To me this is more telling that the replication...

  • RE: Query runs slower in SP

    sk.sarim (5/10/2010)


    [font="Courier New"]I think U R using a view to query ur results.

    while creating a view use nolock in ur create view statement, and then try it. for ex:

    CREATE VIEW...

  • RE: Are the posted questions getting worse?

    Wow, bad advice from first and only post , is this some form of record 🙂

    http://www.sqlservercentral.com/Forums/FindPost918818.aspx

  • RE: NTILE

    Its not the same ,

    That would split 99 rows into 3 tiles each containing 33 rows,

    what i was after would split the 99 rows onto 33 tiles.

  • RE: NTILE

    Hi Paul

    As i say im trying to avoid a sort further downstream , which is happening due to using the result of a row_number to effectively do an NTILE. So...

  • RE: NTILE

    Agreed. Normally i would use NTILE with a constant value, but in this case i was playing around try to avoid a sort 'downstream' where i was using an...

  • RE: Need help with getting last and previous value

    By fairly simply passing it through and also 'partitioning' on it

    With CteRows

    as

    (

    select Account, ServiceCode,ConsumptionVal ,TranDate, RowID,ROW_NUMBER() over(PARTITION by Account, ServiceCode order by RowID desc) as Rown

    ...

  • RE: Query performance before execution plan is cached, runs fine afterwards

    Assuming that is it just the parsing / optimization phase that is taking the time , then try giving SQLServer ALL the information you can.

    ...

  • RE: Need help with getting last and previous value

    Something like this ?

    With CteRows

    as

    (

    select Account,ConsumptionVal ,TranDate, RowID,ROW_NUMBER() over(PARTITION by Account order by RowID desc) as Rown

    from <yourtable>

    )

    Select Account,min(case when...

  • RE: XML Source Adaptor

    ahhhhhhhhh , Sorted.....

    The full schema has two "Occupancy" nodes.

    So to distinguish , it has given the "full path". Doh...

  • RE: Query runs slower in SP

    It does sound like a parameter sniffing or statistics issue, if you have followed the advice in the SO question it should of sorted it.

    Can you post the execution...

Viewing 15 posts - 886 through 900 (of 1,825 total)