Forum Replies Created

Viewing 15 posts - 601 through 615 (of 1,229 total)

  • RE: Select Query - need optimization

    SQL Kiwi (1/15/2012)


    The error about the engine not being able to obtain a LOCK resource is a consequence of a server with a small amount of configured memory, and an...

  • RE: Select Query - need optimization

    Sample data for testing:

    DROP TABLE Table_1

    CREATE TABLE Table_1(

    RowID INT IDENTITY (1,1) PRIMARY KEY CLUSTERED,

    custid INT,

    store VARCHAR(9) NOT NULL,

    amount INT)

    INSERT INTO Table_1 (custid, store, amount) -- 2 million...

  • RE: Comparing data row by row....

    martin.david (1/15/2012)


    ChrisM@home (1/15/2012)


    Hi Martin

    By "sequence in data" - do you mean sequence by ID?

    Cheers

    Hi,

    i'm sorry, maybe i'm using wrong word for my problem..

    sequence that i mean is same transaction that...

  • RE: Select Query - need optimization

    How many distinct stores are there in each table?

  • RE: Comparing data row by row....

    Hi Martin

    By "sequence in data" - do you mean sequence by ID?

    Cheers

  • RE: Comparing data row by row....

    SQL Kiwi (1/14/2012)


    ChrisM@home (1/14/2012)


    Paul, have you compared the performance of this method against a rCTE yet? I must admit I should have but haven't taken the time out to do...

  • RE: Comparing data row by row....

    Paul, have you compared the performance of this method against a rCTE yet? I must admit I should have but haven't taken the time out to do it. If I...

  • RE: Select Query - need optimization

    SQL Kiwi (1/14/2012)


    ChrisM@home (1/14/2012)


    Edit: you've got a 700 million row sample data set on your home lappy? Good lord - I need an upgrade.

    No, I just ran:

    UPDATE STATISTICS dbo.Table_1

    WITH...

  • RE: Select Query - need optimization

    Thanks Paul - looks like it's time to revisit Gail's NOT EXISTS vs etc blog 😉

    Edit: you've got a 700 million row sample data set on your home lappy? Good...

  • RE: Select Query - need optimization

    In the meantime, you will get some mileage from this

    SELECT custid, store, Amount

    FROM Table_1 t1

    WHERE NOT EXISTS (SELECT 1 FROM table_2 t2 WHERE t2.store = t1.store AND t2.product !=...

  • RE: Select Count from a big table

    Sharon-328725 (1/12/2012)


    Yes it has full text indes, but this query:

    SELECT Count(TBL_TOC.ID_TOC)

    FROM TBL_TOC

    WHERE (CONTAINS(BL_TBL_TOC.TEXT, '"test*"'))

    takes 10 seconds to run...

    It's a very big table with 40,000,000 records!!

    Ten seconds ain't so bad.

    Can...

  • RE: Comparing data row by row....

    Blimey! First post, and you've set up a ton of sample data! Top work!

    I think this is what you're looking for:

    SELECT

    Date,

    Price,

    AskClient,

    Dupes = COUNT(*)

    FROM #trading

    GROUP BY...

  • RE: Help with Counts

    bicky1980 (1/13/2012)


    ...

    Thanks for the reply, if there were 2 duplicate datakeys with different landline values, I would only want this to be counted as one record, as I dont want...

  • RE: Help with Counts

    bicky1980 (1/13/2012)


    Total number of populated Landline fields (Needs to have a unique datakey as well as be unique itself - If the same landline is anywhere else in the ...

  • RE: Help with Counts

    Hi Bicky

    Some very experienced and talented folks are having real difficulty figuring out exactly what you want here, and it looks to me that you might still be figuring it...

Viewing 15 posts - 601 through 615 (of 1,229 total)