Reading Time: 7 minutesSQL Server makes it very easy to change the data type of a column. Maybe you need to make a column larger, or maybe you want to make your table slightly more efficient. Through the ALTER COLUMN statement, we can very easily change a column’s data type. In this very Continue Reading
SQL Questions
How to escape a single quote in SQL Server
Reading Time: 2 minutesSQL Server makes it very easy to escape a single quote when querying, inserting, updating or deleting data in a database. Here’s how it’s done: Just use another single quote For example, let’s take a look at a table called Books: Let’s say we want to insert another row for Continue Reading
How to see the definition of a View in SQL Server
Reading Time: 4 minutesMicrosoft SQL Server makes it very easy to create and use Views within SQL Server Management Studio. In this very brief tutorial, we’ll discuss how easy it is to see the definition of a View after it has been created and saved in your database. If you need a full Continue Reading
How to change a table name in SQL Server
Reading Time: 6 minutesChanging a table name in Microsoft SQL Server is a very easy task. Microsoft has a great built-in stored procedure we can use to easily change a table name. The stored procedure is called SP_RENAME. In this very brief tutorial, we’ll discuss how to use the SP_RENAME stored procedure and Continue Reading
What’s the difference between CHAR and VARCHAR? Answered!
Reading Time: 4 minutesWhen working with character string data types in Microsoft SQL Server, you might see CHAR and VARCHAR and wonder, “What’s the difference between the two“? In this very brief tutorial, we’ll discuss the difference between CHAR and VARCHAR. I actually have a full tutorial on all the character string data types Continue Reading
What is a Candidate Key in SQL Server? Answered!
Reading Time: 7 minutesThere are many different keys in SQL Server that are important to understand. You might have heard the term “Candidate Key” before, but maybe you aren’t exactly sure what that means. Maybe you know a thing or two about Primary Keys and Foreign Keys, but you’re not sure what the term “Candidate Continue Reading
What’s the difference between RANK and DENSE_RANK? Answered!
Reading Time: 5 minutesThe RANK and DENSE_RANK window functions in SQL Server are very handy when you need to gather ranking information from your data. But do you know the difference between the two? The difference is subtle, but important. This tutorial assumes you know a thing or two about window functions in Continue Reading
How to change a column name in SQL Server: Explained for Beginners
Reading Time: 6 minutesSo you need to change a column name in your database. Maybe you messed up the name from the start, or your team decided the name needs to change for business reasons. Either way, it’s got to change. Luckily, the process to change a column name is not too difficult Continue Reading
SQL DECIMAL vs NUMERIC: What’s the difference? (THERE IS NONE)
Reading Time: 2 minutesThis might be the worlds shortest blog post. If you’re looking to understand the SQL DECIMAL vs NUMERIC data types, understand this: The SQL Server DECIMAL and NUMERIC data types are synonyms and can be used interchangeably. I pulled that information directly from the Microsoft documentation: decimal and numeric (Transact-SQL). Continue Reading
The difference between COUNT(*) and COUNT(column): Answered!
Reading Time: 6 minutesWhen I was first starting out with SQL Server, I had a hard time understanding the difference between COUNT(*) and COUNT(column), and how they are used with the GROUP BY clause. Many times, the COUNT(*) function would return the same results as the COUNT(<column>) function, so I just told myself Continue Reading