Forum Replies Created

Viewing 15 posts - 646 through 660 (of 1,156 total)

  • RE: Not sure of best way to select different status values

    Like I said I would not use dynamic sql, if I did not have to. Dynamic SQL does not reuse execution plans and can hinder performance, if there are...

  • RE: Not sure of best way to select different status values

    Ah, much better. Thanks for the tip, I knew the equivilant but didnt even think to use it.

    Thanks.

  • RE: Not sure of best way to select different status values

    Post with Matt's tip.

    CREATE PROCEDURE TEST

    @filter VARCHAR(100)

    AS

    BEGIN

    DECLARE @x XML

    SET @x = '<i>' + REPLACE( @filter, '|', '</i><i>') + '</i>'

    SELECT *

    FROM MyTable

    WHERE [Status]

    IN (SELECT x.i.value('.', 'VARCHAR(7)')

    FROM @x.nodes('//i') x(i))

    END

  • RE: Not sure of best way to select different status values

    Man, I hate how this site strips the XML. You have to change the question marks to open and close xml tags ( )

    DECLARE @x XML

    SET @x = '?i?'...

  • RE: Not sure of best way to select different status values

    I dont know how your tables are indexed or anything but you could use some simple xml to parse a string and retreive values from the table based on the...

  • RE: ANSI Joins and the WHERE clause

    You should note that if you alter the left join to an inner join both queries return the same result. The reason the inner join works is the inner...

  • RE: Help With Query

    I pasted your solution in Jeff and it seems both queries use the same execution plan.

  • RE: Help With Query

    Looks like you beat me to it Jeff. My solution is a little different than yours and I dont know how the performance is different but there is more...

  • RE: Update trigger

    You could actually do something like this:

    create table Test1(

    id int,

    descr varchar(25),

    Col char(1)

    )

    go

    INSERT INTO Test1

    select 1, 'test1', 'Y' union all

    select 2, 'test1', 'Y'

    go

    create table Test2(

    id int,

    descr varchar(25),

    Col char(1)

    )

    go

    INSERT INTO Test2

    select...

  • RE: Narrow down the recordset

    Alorenzini,

    CASE Repflag =

    WHEN RepFlag = (Select Repflag From #Temp WHere r.ConsultantID = d.COnsultantID ) THEN 'x'

    WHEN repFlag =(Select Repflag From #Temp WHere r.ConsultantID = d.COnsultantID AND d.CurrentLevelXID = r.AchieveLevel...

  • RE: Narrow down the recordset

    Please correct me, if I have it wrong.

  • RE: Narrow down the recordset

    Johnnie,

    The stored procedure we helped him with is returning the correct results however he has extended it to work inside his main process. The main process is not marking...

  • RE: Narrow down the recordset

    A case statement is more along the lines of what I was thinking. I was thinking something like this.

    CASE

    WHEN d.CurrentLevelXID = r.AchieveLevel AND

    r.PeriodEndDate < (SELECT MAX(a.PeriodEndDate)

    FROM #temp a...

  • RE: CTE doesn't update correctly

    Do you need to reset mycount after the 72 records have been processed? Otherwise mycount will still be 72 for the second loop through @selectnum

  • RE: Narrow down the recordset

    I really do not know enough about this main process to give a concise answer. I would start by looking at why are joining with a left outer join,...

Viewing 15 posts - 646 through 660 (of 1,156 total)