sp_dates add this proc to your code collection

  • Lowell (4/8/2009)


    i left them out on purpose; the format of 0 = format of 100,1=101 etc; just duplicates of the same formats; I thought it's easier to just stick with the three digit numbers

    Some are the same, but I think if you look at my post, it is obvious that 1<>101, and so on.

  • Heh... somebody please tell me how you're managing to use the old code windows... I really don't like the new ones because of the errors they currently have in them. Thanks...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden (4/8/2009)


    Florian Reischl (4/8/2009)


    So here is my formatting function 😉

    It's another concept than Lowell's but might also help in some cases. Keep in mind, if possible use CONVERT due to a much better performance!

    Edited: Seems that the SQL formatting has problems with this script...

    Interesting... how did you get it to format the code in the old style window using the code IF shortcuts?

    Hi Jeff

    Sorry, I don't understand what you mean.

    Greets

    Flo

  • The purple "windows" that your code is in on this thread is the "old" style and it worked well especially for people to copy from. The new code style window looks like this...

    --===== Create and populate the Tally table on the fly

    SELECT TOP 11000 --equates to more than 30 years of dates

    IDENTITY(INT,1,1) AS N

    INTO dbo.Tally

    FROM Master.dbo.SysColumns sc1,

    Master.dbo.SysColumns sc2

    --===== Add a Primary Key to maximize performance

    ALTER TABLE dbo.Tally

    ADD CONSTRAINT PK_Tally_N

    PRIMARY KEY CLUSTERED (N) WITH FILLFACTOR = 100

    --===== Allow the general public to use it

    GRANT SELECT ON dbo.Tally TO PUBLIC

    ... and has multiple faults... it removes blank lines, double the word "Add", and generally makes a mess of things by removing leading spaces and double spacing many areas when you copy from the code window to your local machine. I have a request in for them to fix it but was wondering how you a Michael managed to get the old "code" IFCodes to work to make the old "purple window" style.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden (4/9/2009)


    The purple "windows" that your code is in on this thread is the "old" style and it worked well especially for people to copy from. The new code style window looks like this...

    --===== Create and populate the Tally table on the fly

    SELECT TOP 11000 --equates to more than 30 years of dates

    IDENTITY(INT,1,1) AS N

    INTO dbo.Tally

    FROM Master.dbo.SysColumns sc1,

    Master.dbo.SysColumns sc2

    --===== Add a Primary Key to maximize performance

    ALTER TABLE dbo.Tally

    ADD CONSTRAINT PK_Tally_N

    PRIMARY KEY CLUSTERED (N) WITH FILLFACTOR = 100

    --===== Allow the general public to use it

    GRANT SELECT ON dbo.Tally TO PUBLIC

    ... and has multiple faults... it removes blank lines, double the word "Add", and generally makes a mess of things by removing leading spaces and double spacing many areas when you copy from the code window to your local machine. I have a request in for them to fix it but was wondering how you a Michael managed to get the old "code" IFCodes to work to make the old "purple window" style.

    Jeff,

    don't beat me, but I see no purple window in my browser. I attached a part of a screen-shot of my post on my machine. It just kills the formatting at {odbc}... . You can quote my post to see there are only usual [ code ] tags. Generally I really like the new formatting, if it wouldn't do things like that. I already recognized the ADDADD bug which is really confusing for some people.

    I have no problems with copy-paste. All the spacing comes local exactly as posted.

    May I ask which browser (version) you use? I'm working with Firefox 3.0.8.

    Greets

    Flo

  • How very strange... your screen shot of my most is as I saw it when I posted it. It's the new code window with colorized code and the whole 9 yards including the error. Now, when I look at that same post, it's in the old purple window and it has no errors. From the edit window, as I'm typing this response, I can clearly see my post with the new code window and the errors.

    Lordy, I hope they get this straightened out soon. Steve Jones told me they were working on it and a new release should occur soon.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • BWAA-HAAA! And, just as soon as I posted that, my code in your quote became the old purple window. Like you said, don't beat me, but I'm using the relatively archaic IE7. Perhaps it's time for an upgrade but I know lot's of good folks that still use IE7 and I try to "stay behind the times" a bit so I can help them and to avoid the "bleeding edge".

    Thanks for the feedback, Flo.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 7 posts - 16 through 21 (of 21 total)

You must be logged in to reply to this topic. Login to reply