Forum Replies Created

Viewing 15 posts - 3,421 through 3,435 (of 8,731 total)

  • RE: Find and Remove Duplicate Records SQL Server

    Brandie Tarvin (2/3/2016)


    Luis Cazares (2/3/2016)


    Brandie Tarvin (2/3/2016)


    SQLian (2/3/2016)


    Not sure if I am missing something here, but why can't the following be used?

    delete [FROM] Customers

    where CustID NOT in (

    ...

  • RE: CHARINDEX in reverse

    misscrf (2/3/2016)


    I found this post in trying to split a full name with first, middle and last. I came up with this solution and thought I would share, in...

  • RE: Find and Remove Duplicate Records SQL Server

    SQLian (2/3/2016)


    Yes, my bad as I failed to read the original question properly. I assumed wrongly that CustId was a PK.

    I'll return to my cave.

    Your approach is certainly better than...

  • RE: Trying to replace UNION

    It might be caused by how the date ranges are handled. The union might allow to get a more straight forward plan.

    Maybe if you combine the solutions, you could get...

  • RE: CONNECTing to SQL Server

    Hugo Kornelis (2/3/2016)


    At first I had the server option selected as well.

    Then I recalled that the connect option at server level is actually called CONNECT SQL, not just CONNECT, so...

  • RE: Find and Remove Duplicate Records SQL Server

    Brandie Tarvin (2/3/2016)


    SQLian (2/3/2016)


    Not sure if I am missing something here, but why can't the following be used?

    delete Customers

    where CustID NOT in (

    ...

  • RE: Find and Remove Duplicate Records SQL Server

    Ed Wagner (2/2/2016)


    Luis Cazares (2/2/2016)


    o.kaesmann (2/2/2016)


    My faforite method to clean-up duplicated rows is this (I used the example code from above):

    That's certainly interesting. I've never heard of %%physloc%% before and...

  • RE: Are the posted questions getting worse?

    Sean Lange (2/2/2016)


    Luis Cazares (2/2/2016)


    <rant>

    I'm not sure what's worse. An article promoting RBAR code or comments arguing that the code in the article won't work even if it does.

    Some people's...

  • RE: Are the posted questions getting worse?

    <rant>

    I'm not sure what's worse. An article promoting RBAR code or comments arguing that the code in the article won't work even if it does.

    Some people's fingers work faster than...

  • RE: Find and Remove Duplicate Records SQL Server

    John Donaldson (2/2/2016)


    This will delete all of the records that have more than 1 occurrence including the original.

    I guess you didn't try the code. Here, let me give you the...

  • RE: t-sql 2012 self joins

    Can you post sample data with expected results?

    This seems like an EAV design which wouldn't need self joins, it only needs cross tabs using the MAX() aggregate function.

    Here's a basic...

  • RE: Code fails when 1000 or more rows in source table

    Why are you converting RowID to strings? You're only adding work to the server with no real purpose.

    Try this to see if it works correctly.

    SELECT Tt.rowid,

    ...

  • RE: Simple replace() not working

    You're trying to replace using the wildcard, which is not a wildcard in the REPLACE function.

    Here's an example of possible corrections:

    CREATE TABLE #Titles_Import(

    [LC Call Num] nvarchar(255) collate SQL_Latin1_General_CP1_CI_AS...

  • RE: Special Character Removal

    Something like this?

    DECLARE @SpecialChar char(3) = '%#%' --Example of special character

    SELECT *

    FROM myTable

    WHERE Stringcol1 LIKE @SpecialChar

    OR Stringcol2 LIKE @SpecialChar

    OR Stringcol3 LIKE @SpecialChar;

    Don't use this in production code. This should be...

  • RE: Find and Remove Duplicate Records SQL Server

    marquito_61 (2/2/2016)


    But this method eliminates all duplicate records

    that is wrong

    As far as I know, none of the code posted in the article of the forum eliminates all rows with duplicates,...

Viewing 15 posts - 3,421 through 3,435 (of 8,731 total)