Forum Replies Created

Viewing 15 posts - 5,116 through 5,130 (of 5,678 total)

  • RE: Nonclustered Index on Temp Table

    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.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: Nonclustered Index on Temp Table

    Goldie Lesser (11/2/2010)


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


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

    All 3 of these fail:

    CREATE TABLE #Table1

    (

    ...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: table variable inside a cursor

    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 #tmp (tID...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: How to average a date column?

    Hm, the only solutions I'd have for you with this puzzle would be in T-SQL code, not at the reporting layer.

    If you really wanted a date average, you could take...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: Nonclustered Index on Temp Table

    Just to make sure they didn't change something on me in 2k8...

    From: http://msdn.microsoft.com/en-us/library/ms188783.aspx

    index_name

    Is the name of the index. Index names must be unique within a table or view but...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: Are the posted questions getting worse?

    Brandie Tarvin (11/2/2010)


    GilaMonster (11/2/2010)


    WayneS (11/2/2010)


    Date field stored as varchar(8000) - what kinds of problems do you see coming up from this OP?

    8000 characters for a date? I could store an...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: table variable inside a cursor

    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 I had...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: help needed with datetimes

    Naidu,

    Note that it's all on the #tmp table, which is a temporary build in the tempdb, not a permanent structure. You should have the rights to run both that...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: Performance - fast query running slow in a stored procedure

    Welp, we barked up the wrong tree... those plans are nearly a match.

    *takes the problem to his pillows and sleeps on it*

    EDIT: I take that back. Dug a little...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: help needed with datetimes

    WayneS (11/1/2010)


    What determines the order that the rows need to be compared in?

    Is there an identity column on this table?

    See above, islanded on the ostid..something and then sorted by the...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: help needed with datetimes

    NOTE: You need the #tmp here, it's not the source data build. It works off the sample data you gave us earlier. What this does is basically create...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: help needed with datetimes

    There's a couple of different techniques and approaches to this and I don't want to give you an over-complicated one if unnecessary. You've posted in the 7.0/2k forums. ...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: help needed with datetimes

    naidu4u (11/1/2010)


    but for any refotsid for the first row XYZ should be a datediff(minute, DateChanged, OTtime)

    and for the remaining rows in the same refotsid, XYZ should be datediff(minute, DateChanged of...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: help needed with datetimes

    I still need to have a better understanding of this before I can even ask what to do with the non-datetimes:

    refotsid = 48242 then for the first row I need...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: Are the posted questions getting worse?

    Can someone swing through here and see if they can understand what he's looking for better than I can? Or can maybe phrase what we need in a way...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

Viewing 15 posts - 5,116 through 5,130 (of 5,678 total)