Forum Replies Created

Viewing 15 posts - 226 through 240 (of 3,957 total)

  • RE: Update with Recursive CTE?

    Jeff Moden (3/19/2015)


    isaac.asher (3/19/2015)


    My idea was most definitely painful...... and I figured someone out there had a simple solution. Mr or Mrs 500 had exactly the solution I needed!...

  • RE: Update with Recursive CTE?

    This is a quiz. Which is faster?

    This:

    RIGHT('0000000000' + YOUR_ACCOUNT_NUMBER, 10)

    Or this:

    RIGHT(10000000000 + YOUR_ACCOUNT_NUMBER, 10)

    No need to wait for the answer: The One Million Row T-SQL Test Harness[/url]

  • RE: Using a Date compariason in a Case statement

    May I ask, why all the WHENs?

    CASE

    When YEAR([LastHireDate]) < Year(@EndYearlyDate) then '12'

    ELSE 13- Month([LastHireDate])

    End As LastHireDate,

    Doesn't that get you the same thing?

  • RE: Help with tsql querry

    ChrisM@Work (3/19/2015)


    Further to Gail's comments, Dwain Camps wrote this article [/url]just for you. Enjoy.

    I did? I mean, I did!

  • RE: Insert subset of self-referencing table into that table

    How about something simpler like this?

    INSERT INTO #Table

    SELECTnParent_id + SCOPE_IDENTITY(), cGroup, cValue

    FROMtTable;

  • RE: Are the posted questions getting worse?

    Thinking out loud but bad thoughts, so post deleted.

  • RE: SQL Query Divide Amount between months

    Use a calendar table or equivalent:

    WITH Months AS

    (

    SELECT m=1, mn='January'

    UNION ALL SELECT 2, 'February'

    UNION ALL SELECT 3, 'March'

    ...

  • RE: Need help with running total with thresholds

    Using Alan's setup data:

    Alan.B (3/18/2015)


    IF OBJECT_ID('Tempdb..#TABLE1') IS NOT NULL DROP TABLE #TABLE1;

    CREATE TABLE #TABLE1

    (

    xid int primary key,

    isx char(5) not null

    CHECK (isx IN ('TRUE','FALSE')),

    Revenue int not null,

    );

    Given that this...

  • Viewing 15 posts - 226 through 240 (of 3,957 total)