Forum Replies Created

Viewing 15 posts - 346 through 360 (of 557 total)

  • RE: Delete duplicate rows from ANY table.

    Gazareth (8/4/2015)

    For cases where there are children, you can avoid violating constraints by deleting in child -> parent order as I specified.

    No date gets deleted. All data has to move...

  • RE: Delete duplicate rows from ANY table.

    Gazareth (8/4/2015)That's really really easy then, probably the best case scenario. Merge the duplicate top levels based on whatever rules you have for this situation then delete the one with...

  • RE: Delete duplicate rows from ANY table.

    Gazareth (8/4/2015)

    Either of these should work, but you're back to the problem of determining column names:

    Yes back to the problem of determining the column names. And then de solution becomes...

  • RE: Delete duplicate rows from ANY table.

    ChrisM@Work (8/4/2015)


    ScottPletcher (8/3/2015)


    You can cancel the identity property by using a union or union all:

    select top (0) * into #D from D1 union all select top (0) * from d1

    insert...

  • RE: Delete duplicate rows from ANY table.

    Sean Lange (8/3/2015)

    In your example of being unable to move data it is easily solved by moving the bottom most level to one of the existing accounts. Do the same...

  • RE: Delete duplicate rows from ANY table.

    Luis Cazares (8/3/2015)


    If a constraint prevents actions that are valid, it's a design fault. Can you give an example on a constraint that prevents actions which are functional?

    We have clients,...

  • RE: Page Life Expectancy.

    Grant and Jeff,

    Next to showering this weekend I finished a book, and enjoyed that very much. It does anwser a lot of questions, most questions are anwsered extensively, none of...

  • RE: Page Life Expectancy.

    Grant Fritchey (8/3/2015)


    Don't get hung too much on PLE.

    Thanks for you reply.

    I do tend to get hung up to much by 'numbers' in general, and like to understand how these...

  • RE: Delete duplicate rows from ANY table.

    This weekend I have been away from the keyboard. And as often the best idea's occure when away from the keyboard. E.g. on my bike (pushbike) or under the shower....

  • RE: Delete duplicate rows from ANY table.

    Enforcing constriants often prevents actions. Most of the time it prevents 'illegal' actions. But sometimes it prevents actions, which are functional.

    In general I am in favor to enforce constraints in...

  • RE: Delete duplicate rows from ANY table.

    Sean Lange (7/31/2015)


    You should avoid the sp_ prefix on your procedures. It is reserved for MS and denotes it as a system procedure. The performance issues are mostly corrected but...

  • RE: Delete duplicate rows from ANY table.

    All thanks for your contributions.

    Luis Cazares, thanks for your solution. Next monday I'll study it and try it.

    Although not simple, I probably could wrap this up in a stored procedure.

    If...

  • RE: Need to Show Item Only Once in a List

    ;

    With

    A as (

    SELECT

    ROW_NUMBER() OVER(PARTITION BY PartNumber, MfgSerialNumber ORDER BY InspectionDate desc) subnumber

    ,*

    FROM TestGroup

    WHERE PartNumber...

  • RE: User_Scans User_Seeks User_Lookup User_Updates

    Thanks again.

    Did not realise that a select top 1 would count as a 'scan'.

    I do use the TOP a lot, but not in a production environment. (At least not without...

  • RE: User_Scans User_Seeks User_Lookup User_Updates

    GilaMonster (7/30/2015)


    Nope.

    A key/rid lookup is done to fetch columns which are not present in the index used. It's not related to a seek, you can get index scans with key...

Viewing 15 posts - 346 through 360 (of 557 total)