T-SQL: Bad Habits and Best Practices with Aaron Bertrand
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
This video is so good. Should have more views. Learned a lot. Thank you!
Thanks Brent for sharing this, Thanks Aaron Bertrand your session helped me a lot to improve my codes and be a better coder.
Excellent session! Thx!
Is the code available anywhere? The groupby link is 404.
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.
Use Semi colons because so many other languages require it.
re regional date formats, what about SELECT CONVERT(datetime '10 jul 2017')? ... its clear and indisputable what I meant
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.
I like tabs :-(