Forum Replies Created

Viewing 15 posts - 5,101 through 5,115 (of 10,144 total)

  • RE: Execution Plan - Key Lookup

    satyanj (3/5/2013)


    My question is why the "Key Lookup" is shown BELOW the "Index Seek" and not AFTER it when reading the plan from right to left.

    Because it looks better đŸ˜‰

  • RE: Grouping records by time interval

    b ghanekar (3/6/2013)


    I think the window functions should be of help here.

    Please repost the data I am not able to get the data you have posted.

    The fourth post on this...

  • RE: Grouping records by time interval

    geert.de.vylder (3/5/2013)


    ... if the rows are null they are repeated several times....

    There will be many many rows in the matrix table which don't have a matching ticket, hence null values...

  • RE: SELECT list block with CASE?

    jshahan (3/5/2013)


    DECLARE @X TINYINT = 0

    ;WITH SampleTable AS (

    SELECT SOMECOLUMNS = 'SOMECOLUMNS', COLUMN1 = 'COLUMN1', COLUMN2 = 'COLUMN2', COLUMN3 = 'COLUMN3',

    COLUMN4 = 'COLUMN4', COLUMN5 = 'COLUMN5', COLUMN6 = 'COLUMN6'

    )

    SELECT SOMECOLUMNS,...

  • RE: Conditional join update

    Deepthy (3/5/2013)


    Thanks for the update.

    But joins in the 3 update statements are different.

    Not sure of a way to bind them into one statement.

    Deepthy

    You got me.

    Try this:

    UPDATE dbo.DatasiteConfigBMPANConfiguration SET

    EnergisationStatus =...

  • RE: Table Value Function VS ORs

    PiMané (3/5/2013)


    Is SQL Sentry Plan more accurate than the Execution Plan from SSMS?!

    I ask this cause in SSMS the TVF is better but in Sentry Plan iTVF is much better...

    Thanks,

    Pedro

    You...

  • RE: Conditional join update

    UPDATE d SET

    EnergisationStatus = CASE

    WHEN c.DataSiteConfigATableName = 'DataSiteConfigAEnergisationStatus' THEN b.EnergisationStatus

    ELSE EnergisationStatus END,

    MeasurementClassRef = CASE

    WHEN c.DataSiteConfigATableName = 'DataSiteConfigAMeasurementClass' THEN b.measurementClassRef

    ELSE MeasurementClassRef END,

    ProfileClass = CASE

    WHEN c.DataSiteConfigATableName = 'DataSiteConfigAProfileClass' THEN b.ProfileClass

    ELSE...

  • RE: Table Value Function VS ORs

    PiMané (3/5/2013)


    ChrisM@Work (3/5/2013)


    You should avoid this syntax:

    UPDATE AcumuladosContas SET MES12DB = MES12DB + 5000.00

    FROM dbo.GetSubContasTVF('111') t

    WHERE TipoLancamento = '000' AND Ano = 2012 AND Moeda = 'EUR'

    AND...

  • RE: Table Value Function VS ORs

    You should avoid this syntax:

    UPDATE AcumuladosContas SET MES12DB = MES12DB + 5000.00

    FROM dbo.GetSubContasTVF('111') t

    WHERE TipoLancamento = '000' AND Ano = 2012 AND Moeda = 'EUR'

    AND Conta =...

  • RE: Table Value Function VS ORs

    You can't compare queries like this - you have to time them using a realistically-sized data set. "% of the batch" is 100% unreliable.

    If a function contains a BEGIN/END block...

  • RE: MERGE problem -> when I need to reenter an entry which is already in the history

    chingarova (3/5/2013)


    ok, lets say that the script look like this:

    It's an improvement in that you now have a "key" (not ideal - not everybody has an email address, many folks...

  • RE: Table Value Function VS ORs

    Try using a proper iTVF, the performance will be far better:

    ALTER FUNCTION [dbo].[GetSubContasTVF](@Conta NVARCHAR(20))

    RETURNS TABLE

    AS

    RETURN SELECT SUBSTRING(@Conta, ID, LEN(@Conta)) SubConta FROM PriTally WHERE ID BETWEEN 1 AND LEN(@Conta) -...

  • RE: Query to get rows if value contains result of another query

    winmansoft (3/5/2013)


    ChrisM@Work (3/5/2013)


    This is the simplest way to write it. If it generates dupes, then we'll change one side to a derived table. Can you use something a little more...

  • RE: Extract only the last three days

    cms9651 (3/5/2013)


    Extract only the last three days

    Anything from saturday+sunday+monday, or anything since 72 hours ago from now?

  • RE: Query to get rows if value contains result of another query

    Gazareth (3/5/2013)


    You need to implement Full-Text Indexing before freetext or contains will work.

    I think Chris's solution is the way to go unless you find it's not what you need or...

Viewing 15 posts - 5,101 through 5,115 (of 10,144 total)