Forum Replies Created

Viewing 15 posts - 31 through 45 (of 615 total)

  • RE: SELECT * INTO TABLE

    hoseam (2/7/2014)


    I have this code

    select *

    INTO Hosea_tempTable

    from Hosea_tblDATA_Product_Reports

    and I get this error;

    There is already an object named 'Hosea_tempTable' in the database

    Yes, that's because SELECT INTO attempts...

  • RE: Oddball Interview Questions

    Had an interview on Monday morning which I thought went quite well until the last two questions:

    1) Where do you see yourself in 5 years time?

    2) Your salary expectations for...

  • RE: SELECT * INTO TABLE

    If the target table already exists then you would need to use INSERT INTO

    I always prefer to list the column names in my INSERT INTO and SELECT statements, however you...

  • RE: Query just hangs!

    ChrisM@Work (1/28/2014)


    Gail's suggestion using DENSE_RANK() is well worth a try when you get time.

    Is it?

    So what happens if I have two records with the same Organisationname but the address1 of...

  • RE: Query just hangs!

    Jeff Moden (1/27/2014)


    I haven't checked for all of the columns but the original query had a "Hierarchy" column in it, which is missing from the test data. Considering that...

  • RE: Query just hangs!

    GilaMonster (1/28/2014)


    Abu Dina (1/28/2014)


    David Webb-CDS (1/27/2014)


    I'm afraid you're asking for code that would make these two:

    21ST CENTURY SERIVES

    21ST CENTURY SERVICES

    equal, not because they are, but because they SHOULD be. ...

  • RE: Query just hangs!

    ChrisM@Work (1/27/2014)


    Check the actual plan of each to ensure you're getting an index scan on one side and seeks on the other and check the nested loops join operator carefully...

  • RE: Query just hangs!

    David Webb-CDS (1/27/2014)


    I'm afraid you're asking for code that would make these two:

    21ST CENTURY SERIVES

    21ST CENTURY SERVICES

    equal, not because they are, but because they SHOULD be. Is that true?...

  • RE: Query just hangs!

    TheSQLGuru (1/27/2014)


    We asked specifically (several times) for your expected OUTPUT too.

    In particular, I am unclear on this statement:

    and your task is to add a new column...

  • RE: Query just hangs!

    As requested, sample data below:

    The goal is to dedupe the list of 200 records at Site level. A site being company + address.

    I look forward to see how you guys...

  • RE: Get Distinct Value from each column in a Table

    Another way is to copy the run the contents of the below SELECT statement:

    SELECT 'SELECT DISTINCT [' + COLUMN_NAME + '] FROM ' + TABLE_NAME

    FROM INFORMATION_SCHEMA.COLUMNS

    WHERE TABLE_NAME...

  • RE: Query just hangs!

    ChrisM@Work (1/27/2014)


    They're very narrow triangles - having dealt with this in the near past. Nevertheless, with two of them ORred together, the optimiser will likely choke. Try splitting them up...

  • RE: Query just hangs!

    GilaMonster (1/27/2014)


    Abu Dina (1/27/2014)


    GilaMonster (1/27/2014)


    There's far faster and easier ways to find duplicates than what's looks like half a cartesian product.

    Please share your secret!

    As for avoiding blocking, that's easy, use...

  • RE: Query just hangs!

    GilaMonster (1/27/2014)


    There's far faster and easier ways to find duplicates than what's looks like half a cartesian product.

    Please share your secret!

    Source table looks like the below:

    CREATE TABLE [dbo].[TheTable](

    [ID] [int] IDENTITY(1,1)...

  • RE: Query just hangs!

    Record linkage once again!

    Here I'm looking for records that have the same address! I need to run this query so I can generate a Site ID per record.

Viewing 15 posts - 31 through 45 (of 615 total)