Forum Replies Created

Viewing 15 posts - 44,776 through 44,790 (of 59,063 total)

  • RE: Sum of previous rows till this row.

    souLTower (3/5/2009)


    Jeff, quick question. Since I used a clustered index couldn't I "assume" that the order would be as I want it?

    I know to never assume...

    ST

    Correct... never assume unless...

  • RE: How generate Dates on the fly

    Jeff Moden (3/5/2009)


    Bob Hovious (3/5/2009)


    JEFF !!!! You don't have a tally table available?

    select dateadd(yy,datediff(yy,0,getdate())-5,0)+ N-1

    from dbo.tally

    where N < datediff(dd,dateadd(yy,datediff(yy,0,getdate())-5,0),getdate())+2

    Runs almost a full millisecond faster at 5-10 years....

  • RE: How generate Dates on the fly

    NY153 (3/5/2009)


    No systables as well 🙁

    And tables available don't have seqeunce numbers. They some id columns, but not perfect.

    Very very limited access

    The sys tables don't need to have any...

  • RE: How generate Dates on the fly

    Bob Hovious (3/5/2009)


    JEFF !!!! You don't have a tally table available?

    select dateadd(yy,datediff(yy,0,getdate())-5,0)+ N-1

    from dbo.tally

    where N < datediff(dd,dateadd(yy,datediff(yy,0,getdate())-5,0),getdate())+2

    Runs almost a full millisecond faster at 5-10 years. 😉

    Pretty...

  • RE: "Answered" Posts

    KevinC. (3/5/2009)


    I really like having the OP state whether a particular answer helped them or not and why. I know it helps me when I'm trying to figure out...

  • RE: How generate Dates on the fly

    Thanks Dugi! Great way to start the day!

  • RE: BCP Format File

    Not exactly... post the first 5 rows of one of the data files you intend to import with this and we'll show you how...

  • RE: How generate Dates on the fly

    NY153 (3/4/2009)


    How generate Dates on the fly? At runtime for the last 5 years, current year -5 starting from 1st Jan.

    I needed for the left JOIN, so I can get...

  • RE: Update a table by selecting the max record

    Chirag (3/4/2009)


    You cant do the Select & Update in a single query.

    Ummm... I'm pretty sure you can... see Glenn's post above. That's one of the reasons I love SQL...

  • RE: Create a daily record from date ranges

    Heh... must be budget planning time again. This should do it, John.... I'm using Master.dbo.spt_Values as if it were a Tally table...

    DECLARE @Description VARCHAR(20),

    ...

  • RE: Problems sending string parameter to a SP

    GSquared (3/4/2009)


    The fastest way I know of to parse a simple string like that is to convert it to XML and then query that. That only works if you're...

  • RE: A bit of an abstract problem

    Punketal (3/4/2009)


    That worked cheers mate...

    one more question, say I wanna take first and last year and skip all the ones in the middle?

    Just curious... why would you need to do...

  • RE: a<>b OR not(a=b)

    jungnaja (3/4/2009)


    Thanks everyone!

    I personally prefer a<>b, but we have a senior programmer at work who loves not(a=b).....not(Is Null).....not(whatever). I can't just say it's difficult to debug the...

  • RE: how can i avoid cartesian join?

    Heh... it's easy and I'll tell you... right after you tell me why you'd want to do such a thing... you know... what are the business requirements that require this...

  • RE: BCP Format File

    bicky1980 (3/4/2009)


    Hello

    Is anyone able to send me an example of a Format file to be used in conjuction with the BCP command to create a comma delimited text file which...

Viewing 15 posts - 44,776 through 44,790 (of 59,063 total)