Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

Data Management

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Your profile

    Search

    XML Feeds

    Google Ads

    « Anecdotes about SQL AKA post 400Showing sysjobhistory run_duration in HHMMSS format »
    comments

    SQL Server 2012 is around the corner, perhaps you are ready to upgrade and perhaps you are not. Maybe you just have upgraded to SQL Server 2008 R2 without software assurance and thus you don’t qualify for SQL Server 2012 upgrades.. Even though most people are on SQL Server 2005 or higher these days, I see plenty of database code that is being written today in SQL Server 2000 syntax; I guess old habits are hard to break indeed! In the next 25 days I want to take a stab to identify 25 of these habits and see if we can bring them to this century. Think of it as the “SQL Server upgrade your code” advent calendar.

    Another reason I want to do is because some of the 2000 syntax or pre 2000 syntax won’t work anymore in SQL Server 2012 Are you still using old style left joins with *= and =*? If so then you will be greeted with the following message: Incorrect syntax near '*'.

    Most people who upgrade do something like this: backup the database, restore on the new server, sometimes set the compatibility level to whatever is the current one and they are done. This will work of course but you can do much better, why not changing some of the code to take advantage of new features, maybe all you want is the date instead of datetime, just making this change will save 5 bytes per row.

    Another advantage of using new functionality is that it is better for your career. I interview plenty of people who have SQL Server 2005 and 2008 on their resume, I have yet to find one person who can write the ROW_NUMBER() syntax on the whiteboard for me. The snapshot isolation level is another mystery to the people I have interviewed. The blessing of an IT worker is that you will never be bored, there is always something to learn. The curse is the same as the blessing, if you don’t keep up then you become obsolete. Your job really doesn’t end when you get home, you have to spend an additional 10 -20 hours a week upgrading your skills, this can be done by listening to podcasts, messing around with the latest CTPs, answering question in forums , reading blogs and maintaining your own technical blog

    Hopefully I didn’t ramble on too much about keeping your skills up to date but it is very important!!

    December 1st I will have part 1 out of 25 posted, keep coming back every day and we will do a recap after day 25.

    Day 1: Date and time
    Day 2: System tables and catalog views
    Day 3: Partitioning
    Day 4: Schemas
    Day 5: Common Table Expressions
    Day 6: Windowing functions
    Day 7: Crosstab with PIVOT
    Day 8: UNPIVOT
    Day 9: Dynamic TOP
    Day 10: Upsert by using the Merge statement
    Day 11: DML statements with the OUTPUT clause
    Day 12: Table Value Constructor
    Day 13: DDL Triggers
    Day 14: EXCEPT and INTERSECT SET Operations
    Day 15: Joins
    Day 16: CROSS APPLY and OUTER APPLY
    Day 17: varchar(max)
    Day 18: Table-valued Parameters
    Day 19: Filtered Indexes
    Day 20: Indexes with Included Columns
    Day 21: TRY CATCH
    Day 22: Dynamic Management Views
    Day 23: OBJECT_DEFINITION
    Day 24: Index REBUILD and REORGANIZE

    About the Author

    User bio imageDenis has been working with SQL Server since version 6.5. Although he worked as an ASP/JSP/ColdFusion developer before the dot com bust, he has been working exclusively as a database developer/architect since 2002. In addition to English, Denis is also fluent in Croatian and Dutch, but he can curse in many other languages and dialects (just ask the SQL optimizer) He lives in Princeton, NJ with his wife and three kids.
    Social SitingsTwitterFacebookLinkedInHomePageFlickrLTD RSS Feed
    1443 views
    Instapaper

    7 comments

    Comment from: Rob Sullivan [Visitor] · http://DataChomp.com
    Rob Sullivan I'm excited about SQL Server 2012 just as much as the next guy... but good time management also tells me it is still quite a few months away from being a purchasable product. With that in mind, I'm focusing on learning real products until the actual product launch gets closer.... or set for that matter.
    11/27/11 @ 08:07
    Comment from: SQLDenis [Member] Email
    SQLDenis Rob,

    thanks for the comment...what you are saying is true..that is also why I will cover stuff that was added in 2005 and 2008 only. I see database on 2008 and they are still inserting into a temp table with an identity column or are doing a running count to get a row number, why not use ROW_NUMBER() instead? That is what I am focusing on with these posts...bringing the code up to 2005 and 2008 level from 2000 and earlier. I won't really cover any 2012 stuff or I might just mention it at the end and show a small example of how it is done in 2012...OFFSET for paging instead of ROW_NUMBER() is such an example

    11/27/11 @ 08:23
    Comment from: Robert L Davis [Visitor] · http://www.sqlsoldier.com
    Robert L Davis I see a lot of people complaining about the quality of candidates coming in for interviews. At the same time, I see a lot job offerings that are not geared to finding the top talent. Everyone seems to want to hire top talent, but nobody wants to pay for it.

    If you're paying bottom tier or middle tier rates, you're only going to get bottom tier or middle tier candidates.
    11/27/11 @ 11:11
    Comment from: SQLDenis [Member] Email
    SQLDenis Top talent is one thing..having 10 years experience but not be able to write a group by..having count(*) query is another thing
    or not know what the biggest number you can store in decimal(6,5) is just something a developer with 2 years experience should know

    Ask people when they can't do a truncate and you will get all kind of creative answers

    Difference between UNION and UNION ALL is another question where the answers are very very surprising
    11/27/11 @ 11:27
    Comment from: Jack Corbett [Visitor] · http://www.wiseman-wiseguy.blogspot.com
    Jack Corbett I'm surprised that there are people out there who can't whiteboard ROW_NUMBER(). There are so many places where it can be used to solve problems. I might not be able to explain everything new in 2008 & R2, but I know most of it.

    I do try to keep up, but honestly I learn/retain what I need to get my job done on a daily basis. I really on get surface knowledge of the newer technologies so I can try to understand situations where they would be helpful so I can intelligently present valid upgrade reasons to the boss.
    11/27/11 @ 12:39
    Comment from: Richard Lewis [Visitor] · http://www.gogorichie.com
    Richard Lewis I look forward to reading you series i'm still running a SQL 2000 database in production which is slated to migrate over next year anyway.
    11/29/11 @ 11:52
    Comment from: Manoj [Visitor]
    Manoj good one. still have to go through all your series....
    thanks for sharing this.
    01/22/12 @ 23:29

    Leave a comment


    Your email address will not be revealed on this site.

    Your URL will be displayed.
    (Line breaks become <br />)
    (Name, email & website)
    (Allow users to contact you through a message form (your email will not be revealed.)