What are the important advance topics in SQL server that every programmer should learn?

What is SQL Server?
SQL Server is a database server by Microsoft. ... SQL is a special-purpose programming language designed to handle data in a relational database management system. A database server is a computer program that provides database services to other programs or computers, as defined by the client-server model,If you are intrested to learn about SQL server DBA please visit SQl Server DBA online training Hyderabad


I don’t think there are “advanced” topics within T-SQL that every programmer has to know. I do think there are fundamentals that every programmer ought to know that, based on my experience, they don’t. A few of these include:
  • Normalization, done properly, is a good thing that not only helps make the data better, but enhances performance and makes coding easier, not harder.
  • T-SQL is based on the concepts of sets. When you start trying to deal with data as individual rows through WHILE loops and cursors, you’re leaving that behind.
  • One column for one piece of information. Don’t try to overload behaviors, see normalization above.
  • The data type matters. Sure, you can store that date in a very pretty format if you make it a varchar, but you’ve now committed yourself to not using date math and/or lots of CAST statements, which not only clutter the code, but destroy performance.
  • T-SQL does not lend itself to code reuse. Yeah, writing a JOIN between the same four tables over and over is a pain, but writing views that join to views that query views, etc, ad infinitum, cripples the query optimizer and destroys performance. Bite the bullet, write the JOIN more than once.
  • NOLOCK is absolutely not some secret run faster button that you’ve discovered and should not be added to every query. In fact, NOLOCK leads to missing data or duplicate data in your queries. Please don’t write software that manages my bank account using NOLOCK.
  • Parameterize your queries. I not only don’t care that you’re using an ORM tool, I actively encourage it’s use. Why? Every one I’ve worked with, out of the gate, parameterizes the queries. Why is this so important? It reduces the number of queries that have to be compiled, improving system performance. It reduces the number of plans that have to be stored in cache, enhancing memory management within the system. Probably most importantly, it prevents SQL Injection attacks.
  • Learn about SQL Injection and how to avoid it. To quote my kids, it’s current year.
That should about cover it. If every single developer working against the database knew this stuff, then maybe I could come up with some advanced topics for them all to learn too.

Comments

Popular posts from this blog

Android Interview Questions And Answers

Ten Things a Junior DBA Should Learn

SQL Server Interview Questions & Answers