Forum Replies Created

Viewing 15 posts - 256 through 270 (of 533 total)

  • RE: Query - Start Date, End Date count for each year

    The problem I have with the case statements is that they're a bit ugly to work with (especially when you get more and more) and they're not dynamic. So,...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: query help

    No left join is needed for this so I wouldn't use one either.

    ;WITH cteTemp

    AS

    (

    select [EMP],

    [order_no],

    EmpAccts = DENSE_RANK() OVER (PARTITION BY [EMP] ORDER BY [order_no]),

    EmpRes = ROW_NUMBER() OVER (PARTITION BY [order_no]...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Help Understanding Row_Number

    david.c.holley (7/14/2010)


    However, I would swear up and down that I've seen example where the value of the Row_Number is referenced in the WHERE statement without using WITH() AS.

    It's possible you...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Data From active directory

    Supposedly you can create a linked server and query that way. Take a look at this article: OLE DB Provider for Microsoft Directory Services. (I just did a...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: I reduced my poor performing query from 10 min to 2 now if I could only use it

    Lynn Pettis (7/8/2010)


    you need a semi-colon like this:

    SET NOCOUNT ON;

    Heh .. some code reviewer I am. I just assumed that it was there because it was discussed.

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Regarding month text - MSSQL 2005

    Can't really tell for sure what you're trying to do big picture, but it looks like you're trying to make 12 entries in a table. One of the big...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: I reduced my poor performing query from 10 min to 2 now if I could only use it

    I'm surprised that's throwing an error, but you can just do

    declare @thisdontmeananything bit;

    with cte ...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: CATCH blocks are resumptive, unless ...

    Thank you for bringing this to the attention of the community.

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Are the posted questions getting worse?

    The Dixie Flatline (7/7/2010)


    You're not going to explain this in a such a way as to make him happy.

    I didn't believe you. Now I do.

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Try Catch alters behaviour of existing procedures

    doobya (7/7/2010)


    If this is common knowledge - prove it with a link

    I have searched this forum and google and found no mention of the dual behaviour issue

    Common knowledge that an...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Try Catch alters behaviour of existing procedures

    doobya (7/7/2010)


    bteraberry (7/7/2010)If you want 'Y' to happen regardless of what happens with 'X' then don't put it in the same TRY.

    that is what I *am* doing! X and Y...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Try Catch alters behaviour of existing procedures

    Also, you can take a look at what happens in your example when you change the proc dbo.spTryTestA:

    create proc dbo.spTryTestA

    as

    --

    begin try

    raiserror('spTryTestA:1', 0, 1)

    end try

    begin catch

    raiserror('spTryTestA:1 failed', 0, 1)

    end catch

    begin try

    raiserror('spTryTestA:2',...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Try Catch alters behaviour of existing procedures

    doobya,

    Let me give you a few suggestions:

    #1. Consider that maybe it's you who isn't understanding what's being said. You're arguing with someone who writes top notch books on SQL...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Nested if problem

    The problem with how you're doing this is that you have 3 nested IF's, but only the outer IF has an associated ELSE. So if your condition evaluates true...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Creating Automated Procedure to Import and Arrange Data

    jvanderberg (7/1/2010)


    Using Excel and CSV files as a permanent data store is ill-advised. Using Excel or CSV for data entry is even worse. The fact that you need...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

Viewing 15 posts - 256 through 270 (of 533 total)