Forum Replies Created

Viewing 15 posts - 7,546 through 7,560 (of 18,923 total)

  • RE: 53,000,000 rows count result but profiler query shows only 115,000 reads. Trying to understand why.

    One more important detail. The SAME page can be read multiple times in that total. So even if the whole table has only 5 pages, the total reads...

  • RE: table variable inside a cursor

    Of course, I was just having fun with the tempdb thingie.

  • RE: table variable inside a cursor

    Yes, but only when running the code in tempdb, that's why I was having a little fun with it in the code snippe with a bunch of usings.

  • RE: Nonclustered Index on Temp Table

    Craig Farrell (11/2/2010)


    Ninja, the CREATE INDEX #idx_1 ...

    also works as CREATE INDEX idx_1...

    Don't need the # for the index name there. Just fyi. Works either way.

    Tx, I used...

  • RE: table variable inside a cursor

    Craig Farrell (11/2/2010)


    Ninja's_RGR'us (11/2/2010)


    Even if it makes no difference here, it should read : IF Object_id('tempdb..#tmp') IS NOT NULL

    With tempdb.. missing you'll never have a hit on that id.

    Hmmmm....

    CREATE TABLE...

  • RE: Nonclustered Index on Temp Table

    That version works. Not using PK but same effect.

    CREATE TABLE #Table1

    (

    TeacherID BIGINT

    , StudentID BIGINT

    )

    CREATE UNIQUE CLUSTERED INDEX #IX_Tbl1 on #Table1 (TeacherID, StudentID)

    CREATE TABLE #Table2

    (

    TeacherID BIGINT

    ,StudentID BIGINT

    ) ON...

  • RE: table variable inside a cursor

    Even if it makes no difference here, it should read : IF Object_id('tempdb..#tmp') IS NOT NULL

    With tempdb.. missing you'll never have a hit on that id.

  • RE: table variable inside a cursor

    Craig Farrell (11/2/2010)


    Yeah, even this doesn't work:

    CREATE TABLE #tmp (tID INT);

    IF Object_id('#tmp') IS NOT NULL

    BEGIN

    DROP TABLE #tmp

    END;

    IF Object_id('#tmp') IS NULL

    BEGIN

    CREATE TABLE #tmp(tID INT, tTxt VARCHAR(50))

    END;

    So, I'm going to go with...

  • RE: Nonclustered Index on Temp Table

    I do that in prod no problem. Can you post the create table and index scripts you are using?

  • RE: table variable inside a cursor

    Craig Farrell (11/1/2010)


    Of course to make my life interesting, this gets grumpy too and I can't remember how to get it to behave offhand. Maybe someone else remembers how...

  • RE: table variable inside a cursor

    Jeff Moden (11/1/2010)


    Craig Farrell (11/1/2010)


    Of course to make my life interesting, this gets grumpy too and I can't remember how to get it to behave offhand. Maybe someone else...

  • RE: Predicting backup size of the database

    Grant Fritchey (11/2/2010)


    Yep, what he said. Generally the size of the data stored will define, in pretty close approximation, the size of the database. You can get the size a...

  • RE: SSRS Error

    I wish I knew the problem but I've never seen that one.

    Hopefully someone else will jump in and figure this one out with you.

  • RE: Calculating interest query

    Y

    Would have been much better, 50% space saved in the DB, and then remove the signature and you're off to the races! :w00t:

  • RE: Query Optimizer and "GoodEnoughPlanFound"

    GilaMonster (11/1/2010)


    Ninja's_RGR'us (11/1/2010)


    Plan cache seems the way to go. I couldn't find an event in the perf category with the info I wanted.

    Bear in mind that you won't find...

Viewing 15 posts - 7,546 through 7,560 (of 18,923 total)