Year 2011 was a year of learning and opportunity for me. My recent book, SQL Server Interview Questions and Answers, has received such overwhelming love and support from all of you. While writing the book, I had two simple goals: (1) Master the Basics and (2) Ignite Learning. There was a constant request from the Community to take the learning of these books to the next level. Here is an article which discusses the Author’s Perspective.
Beyond Relational has come up with a very interesting concept – they have converted a few of the questions from my book into the SQL Quiz. The quiz is indeed focused on my two goals. In addition, it’s going to put the learning of the book to a higher stage. Looking at this novel concept, Vinod Kumar (Co-author) and I have decided to help every participant and reader by giving a few hints and suggestions to solve the quiz.
It is a common saying that, “where you should use a nail, you should not use a sword”. Every little tool has its own usage and its own purpose. What are the differences of CHAR, VARCHAR, NVARCHAR and VARCHAR(MAX) datatypes?
As we start moving our old ways of using “text” datatypes to VARCHAR(MAX), what is it that we get as an advantage? Read about more specific advantages. And while you’re at it, you might as well answer this question: “What is the storage requirements and special cases when using these datatypes?”
When people ask me why there are similarly looking features that exist in any product, here is my response: In the real world, even identical twins are not really identical. Likewise human finger prints are not alike. In the same way, most products do not come up with two similar features. Every feature has its own usage and specific advantages. Therefore as a product consumer, it is our duty to understand the feature correctly and try to take advantage of its positive side. With regards to CHAR, VARCHAR and NVARCHAR, there are three major components to pay attention to: 1) Storage, 2) Performance and 3) Capabilities.
SQL Server Interview Questions and Answers ISBN: 1466405643 Page#85-87
Replace TEXT with VARCHAR(MAX) – Stop using TEXT, NTEXT, IMAGE Data Types
Constraint on VARCHAR(MAX) Field To Limit It Certain Length
Note: The SQL Quiz, winners and prizes are administrated by Beyond Relational. The goal of this blog post is to provide additional learning pointers only.
Reference: Pinal Dave (http://blog.sqlauthority.com)