Forum Replies Created

Viewing 15 posts - 4,411 through 4,425 (of 5,678 total)

  • RE: Assigning values to multiple variables with single SELECT (with a twist)

    GSquared (1/10/2011)


    Since you're using SQL 2008, can you switch from delimited lists of parameter values to a table variable parameter? Those are more efficient.

    I haven't had the opportunity to...


    - 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: Before Insert or Update Trigger

    Not all of us that got it wrong misunderstood the question. Some of us learned/were reminded of something today... like why I always seem to use INSTEAD OF triggers.

    :blush:


    - 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: Rewriting the query without using 'Insert' <Query Optimization>

    mister.magoo (1/10/2011)


    mounish (1/10/2011)


    Well, Even though I am not good at using CT Expressions, According to my knowledge, the following should work. But, if I try this, Its showing error "FROM...


    - 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: Rewriting the query without using 'Insert' <Query Optimization>

    mounish (1/10/2011)


    Tried that too, Still no change !!

    Heh, and if you can't easily compare what you have to Lutz, it sounds like you've buried this in a larger query... can...


    - 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: Rewriting the query without using 'Insert' <Query Optimization>

    If this isn't the first statement in the batch, you need a semicolon.

    Change:

    WITH cte AS

    to:

    ;WITH cte AS


    - 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: Group By Count

    Having COUNT(*) > 3?


    - 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: Best Fit Algorithm/Function

    There's a number of solutions out there, but the problem is you have to know what you're looking for.

    For example, the First-In First-Out logic (FIFO)

    Google: SQL FIFO Inventory

    This is from...


    - 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: T-SQL IF ELSE THEN Statement

    Lamprey13 (1/10/2011)


    What is the question?

    It was in the subtitle on the main page, it doesn't show here, unfortunately, and he didn't realize he'd need to repeat it in the first...


    - 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: T-SQL IF ELSE THEN Statement

    You can't use IF mid-query. IF is used for proc control, not mid-statement decisions, you want CASE for that usually, but neither here...

    So this:

    F @ContactType = 'Broker'

    Begin

    SET s.BrokerID =...


    - 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: Proc Performance

    siamak.s16 (1/10/2011)


    This was an oversimplified version of my proc. I wrongfully assumed that if I ask a question about the where clause, that people would answer the question about 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: Proc Performance

    To answer your question directly:

    No, removing the 1=1 component in the where clause will not affect performance. As a matter of fact, 1=1 never does anything in the optimizer,...


    - 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: Select statement of view stays 5 hours to return results......

    Grant Fritchey (1/10/2011)


    Craig Farrell (1/10/2011)


    Grant Fritchey (1/10/2011)


    This results in a merge join on just a few records. From what I can see, I'd try an index on the PastExperience table...


    - 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: Select statement of view stays 5 hours to return results......

    Ninja's_RGR'us (1/10/2011)


    Craig Farrell (1/10/2011)


    *nearly sprays his tea all over the monitor upon opening the execution plan*

    Yikes. Wow. :w00t:

    Now, THAT'S a Table Spool. Just the estimate, I know,...


    - 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: Getting a mail when a DB is created

    An alternate solution would be to have a server trigger generate a Service Broker item, and then have the recieving queue do a send_db_mail. Or just have the trigger...


    - 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: Import view from another database

    a_ud (1/10/2011)


    I'm trying to import a view from a different database in SQL 2005. The tables already exist, so all I want is to import the view without recreating...


    - 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 - 4,411 through 4,425 (of 5,678 total)