You know you're having a slow day when...

  • So I'm browsing the forums and seeing the usual comments like "please provide code and sample data". I'm sitting there and thinking this isn't that hard. I mean generating scripts in SSMS with data is easy...well for most. I realized this handy feature wasn't made available until 2008 R2 (I believe). That being said there are tools and other scripts out there. Of course here I am thinking "hey, I can make my own just for fun!"

    Well a few hours later I finished. Darn thing works pretty good but it's not without some flaws. Just need to put in your table name and BAM you get your code that you can just copy and paste. However, as I stared at my script I couldn't help but giggle a bit when I realized the journey was much better than the destination. 😉 In the end it was good practice so it's all good.

    Anybody else out there ever written crazy code just for the heck of it?

    (Just some late Friday afternoon musings)

    Have a good weekend!


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

  • yb751 (5/1/2015)


    So I'm browsing the forums and seeing the usual comments like "please provide code and sample data". I'm sitting there and thinking this isn't that hard. I mean generating scripts in SSMS with data is easy...well for most. I realized this handy feature wasn't made available until 2008 R2 (I believe). That being said there are tools and other scripts out there. Of course here I am thinking "hey, I can make my own just for fun!"

    Well a few hours later I finished. Darn thing works pretty good but it's not without some flaws. Just need to put in your table name and BAM you get your code that you can just copy and paste. However, as I stared at my script I couldn't help but giggle a bit when I realized the journey was much better than the destination. 😉 In the end it was good practice so it's all good.

    Anybody else out there ever written crazy code just for the heck of it?

    (Just some late Friday afternoon musings)

    Have a good weekend!

    Heh... seems like every day. Very happy it's Friday because I go totally bonkers on the weekends. 😛

    --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)

  • yb751 (5/1/2015)


    So I'm browsing the forums and seeing the usual comments like "please provide code and sample data". I'm sitting there and thinking this isn't that hard. I mean generating scripts in SSMS with data is easy...well for most. I realized this handy feature wasn't made available until 2008 R2 (I believe). That being said there are tools and other scripts out there. Of course here I am thinking "hey, I can make my own just for fun!"

    Well a few hours later I finished. Darn thing works pretty good but it's not without some flaws. Just need to put in your table name and BAM you get your code that you can just copy and paste. However, as I stared at my script I couldn't help but giggle a bit when I realized the journey was much better than the destination. 😉 In the end it was good practice so it's all good.

    Anybody else out there ever written crazy code just for the heck of it?

    (Just some late Friday afternoon musings)

    Have a good weekend!

    You should turn that into an article, if you haven't already. Lots of people would be interested in your journey.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Gosh... I strongly second what Brandie said. Ending the article with your epiphany that the journey outshined the destination and why make a wonderful addition to the collection of good articles on this site.

    --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)

  • Oh yes! I actually like problem solving, and coding (whether in tsql, java, javascript, c#, whatever) is a rewarding way of doing that, even when the problem may not actually be worth the effort.

    I know, for example, that myself and many other people have spent many a happy hour trying to squeeze another few milliseconds from DelimitedSplit8K (and variants), and this was not because I personally have a great need for it (I don't), but because it was a great way to learn and have fun.

    There have even been a few occasions when I have sat down to write a solution to something, just because I want to, and then produced something so shiny and nice that I think "I'll keep that", only to find I already have - months ago, in the middle of the night!

    It's what makes those long winter nights fly by!

    MM



    select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);

  • Forum Etiquette: How to post Reporting Services problems
  • [/url]
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • [/url]
  • How to Post Performance Problems - by Gail Shaw
  • [/url]

  • Heh... I obviously suffer from the same problem/joy. 🙂

    --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)

  • Brandie Tarvin (5/11/2015)


    You should turn that into an article, if you haven't already. Lots of people would be interested in your journey.

    I hadn't thought of that. It's a good idea but I'm not sure I would make a great 'author'. 😉

    Well at least I'd know what I'd call it..."My journey with Dynamic SQL from hell". LOL

    mister.magoo (5/11/2015)


    There have even been a few occasions when I have sat down to write a solution to something, just because I want to, and then produced something so shiny and nice that I think "I'll keep that", only to find I already have - months ago, in the middle of the night!

    I have completely done the same thing. I save all of my code since you never know when you'll need it again. Too bad I just can't remember what I've written. :crazy:


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

  • I'm with ya... I'd written a piece of obfuscation code that actually worked a little too well for it's intended purpose... Rather than trashing the code, I figured that it may help forum members post test data when even when their production data is way to sensitive to post in an open forum.

    Long story short, a piece of code that originally took about 1/2 to write, now has about 10 hours worth dev time into it... Granted, a fair portion of that was spent changing my mind and saying "Ooh I can make it do that too!"...

    I started on an article but, as it turns out, writing articles is harder than writing SQL...

  • yb751 (5/15/2015)


    Brandie Tarvin (5/11/2015)


    You should turn that into an article, if you haven't already. Lots of people would be interested in your journey.

    I hadn't thought of that. It's a good idea but I'm not sure I would make a great 'author'. 😉

    Well at least I'd know what I'd call it..."My journey with Dynamic SQL from hell". LOL

    Actually, THAT's a great title.

    I also have to tell you that if you just write the article as if you're telling the story to a coworker and trying to show them what you did, the article WILL be great! We're not writing stuff that an English major needs to be proud of. The greatest of all authors for SQL Server are "just" story tellers. Bring your own special personality to the plate.

    --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 9 posts - 1 through 8 (of 8 total)

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