Forum Replies Created

Viewing 15 posts - 256 through 270 (of 898 total)

  • RE: Sql server relationship using between 2 values

    subhajeetsur (5/22/2013)


    u can use between while joining as said in above post but then it will not be optimized solution as ur query performance will hamper.

    Do you have any other...

  • RE: How to delete a record with different column values?

    subhajeetsur (5/22/2013)


    you can use row number with partitions to do the same

    I think that is exactly what Lynn has suggested above.

  • RE: Retrive parent child relation

    This might help you

    ; WITH PRODUCT1 AS

    (

    SELECT*, DENSE_RANK() OVER( ORDER BY P.PARENT ) AS RN, 1 AS Lvl

    FROMPRDST AS P

    WHEREP.PARENT IN ( 1055874, 1055872 )

    UNION ALL

    SELECTPR.*, PR1.RN, PR1.Lvl + 1

    FROMPRDST...

  • RE: Kindly advise , How to create query in sqlserver for below issue,

    You will need a CTE to achieve the results

    DECLARE@table TABLE

    (

    IdINT,

    NameVARCHAR(10),

    Value1INT,

    value2INT,

    PreviousRowId INT

    )

    INSERT@table

    SELECT1, 'A', 10, 0, 0 UNION ALL

    SELECT2, 'B', 0, 5, 1 UNION ALL

    SELECT3, 'C', 0, 6, 2 UNION ALL

    SELECT4, 'D',...

  • RE: Update Statement on specific criteria

    tknecht 32495 (5/21/2013)


    Sorry for the confusion. I'm obviously not an expert.

    The searching I've done for doing what I need suggests using an update statement to add information...

  • RE: Update Statement on specific criteria

    The result you want is exactly the same as what you have.

    Why are trying to update it or am i missing something?

  • RE: Retrive parent child relation

    vishnurajeshsat (5/21/2013)


    Thank you kingston it works but if i want to get more than 1 product details (i.e. 1055874 , 1055872 , etc. ) then how to change the query.

    Something...

  • RE: SIGN

    lmacdonald (5/21/2013)


    That is correct, -1 0 or 1 depending on the previous value compared to the current one. It is working correctly, I just am not processing why I'm...

  • RE: T-LOG ISSUE

    shohelr2003 (5/21/2013)


    Kingston Dhasian (5/21/2013)


    Do you have scheduled log backups or do you monitor and take the log backups manually?

    I have not scheduled it but I do it manually.

    It would be...

  • RE: T-LOG ISSUE

    shohelr2003 (5/21/2013)


    2. Nope, log is not always 87% empty. I monitor it regularly, it becomes like for example 58%, 35%, 12%, 1% free. Then I take log backup and becomes...

  • RE: Retrive parent child relation

    You can use a CTE to do this

    ; WITH PRODUCT1 AS

    (

    SELECT*

    FROMPRDST AS P

    WHEREP.PARENT = 1055874

    UNION ALL

    SELECTPR.*

    FROMPRDST AS PR

    INNER JOIN PRODUCT1 AS PR1 ON PR.PARENT = PR1.CHILD

    )

    SELECT*

    FROMPRODUCT1

  • RE: Invalid object

    philip.davy (5/21/2013)


    Hi

    I've worked out the problem.

    from members_.memberID_ with (nolock)

    shouldn't have memberID_ in the SQL

    Thanks

    Great you could find it out 🙂

  • RE: SIGN

    eklavu (5/21/2013)


    Are you pulling the top first record? No t sure if I understand clearly.

    TOP (1) should be in your main table not on the derived table "sgn"

    SELECT TOP...

  • RE: SIGN

    SELECTmth, qty,

    SIGN( S1.qty -

    (

    SELECT TOP (1) qty

    FROM dbo.Sales AS S2

    WHERE S2.mth < S1.mth

    ORDER BY S2.mth DESC

    /*

    This query is part of your SELECT statement

    It will always return a single value

    That value...

  • RE: Invalid object

    from members_.memberID_ with (nolock)

    Do you have a table named memberId_ which belongs to the schema members_ ?

Viewing 15 posts - 256 through 270 (of 898 total)