T-SQL: Bad Habits and Best Practices with Aaron Bertrand

Sdílet
Vložit
  • čas přidán 19. 01. 2017
  • Whether you are a developer, DBA, or anything in between, chances are you are not always following best practices when you write T-SQL. Unfortunately, many so-called “bad habits” aren’t always obvious, but can lead to poor performance, maintainability issues, and compatibility problems.
    In this session, you will learn about several bad habits, how they develop, and how you can avoid them. While we will briefly discuss advice you’ve probably heard before, like avoid SELECT * and don’t use NOLOCK, you will also learn some subtleties in SQL Server that might surprise you, how some shorthand can bite you in the long run, and a very easy way to improve cursor performance.
    By changing your techniques and ditching some of these bad habits for best practices, you will take new techniques back to your environment that will lead to more efficient code, a more productive workflow, or both.
    Get more information, resources, and more here: groupby.org/session9
  • Věda a technologie

Komentáře • 9

  • @galthrampt6476
    @galthrampt6476 Před 5 lety +3

    This video is so good. Should have more views. Learned a lot. Thank you!

  • @mohammedhassan8522
    @mohammedhassan8522 Před 7 lety +1

    Thanks Brent for sharing this, Thanks Aaron Bertrand your session helped me a lot to improve my codes and be a better coder.

  • @Enzo2102
    @Enzo2102 Před 7 lety

    Excellent session! Thx!

  • @frescani
    @frescani Před 3 lety +3

    Is the code available anywhere? The groupby link is 404.

  • @MethodOverRide
    @MethodOverRide Před rokem

    Anyone wanting the code Google his name and tsql bad habits to bring up recent code repos for him and updated presentation for SQL 2019.

  • @sethsacks9947
    @sethsacks9947 Před 6 lety +1

    Use Semi colons because so many other languages require it.

  • @505509richard
    @505509richard Před 6 lety

    re regional date formats, what about SELECT CONVERT(datetime '10 jul 2017')? ... its clear and indisputable what I meant

    • @NicoleAndAaronBert
      @NicoleAndAaronBert Před 4 lety +2

      Richard, `jul` is English. So, for several languages, it isn't quite disputable, but it's not always going to be obvious to a foreign reader, either. And it breaks. Try `SET LANGUAGE RUSSIAN` first, or finnish, or french, or 90+% of the languages SQL Server supports... what about using an ISO standard? 20170710 is far more clear and indisputable than the regional format you suggest. IMHO.

  • @squirrelpatrick3670
    @squirrelpatrick3670 Před 3 lety +1

    I like tabs :-(