Reading Time: 7 minutesThere are several ways we can guarantee unique values in our primary key columns in our SQL Server tables. One data type we can use to store unique values is the UNIQUEIDENTIFER. In this very brief tutorial, we’ll talk about what the SQL Server UNIQUEIDENTIFIER data type is and how Continue Reading
Data Types
Do you know this rule about the CAST function?
Reading Time: 3 minutesThe CAST() system function is one of the most useful tools we have available to us in Microsoft SQL Server. We basically use it to convert a value from one data type to another on-the-fly. I was using CAST() in a query recently and encountered an interesting problem. If you Continue Reading
How to get the data type of a return value in SQL Server
Reading Time: 3 minutesSometimes when writing T-SQL code (or code in any other language), it can be useful to know the data type of a value returned from an object. I was working on a tutorial recently where I wanted to show you the data type that was returned by an operation, but Continue Reading
SQL Server CONVERT: A How-To Guide with Examples
Reading Time: 7 minutesThe SQL Server CONVERT function is an extremely handy tool to know when it comes to querying SQL Server databases. CONVERT is a system function we can use to very easily convert a value from one data type to another on-the-fly. In this very brief tutorial, you’ll learn everything you Continue Reading
What’s the difference between VARCHAR and NVARCHAR? Answered!
Reading Time: 3 minutesThere are four character string data types in Microsoft SQL Server. They are: CHAR NCHAR VARCHAR NVARCHAR You should definitely choose the best character string data type to suit your needs. But you might look at VARCHAR and NVARCHAR and wonder, what’s the difference? Well, in this very brief tutorial Continue Reading
SQL Server REPLACE: Explained
Reading Time: 4 minutesThe SQL Server REPLACE function is a very simple system function that is built into Microsoft SQL Server. It is one of the best tools you can use for string manipulation in SQL Server. In this very brief tutorial, we’ll discuss the SQL Server REPLACE function and how to use Continue Reading
SQL Server DATEDIFF System Function: Explained
Reading Time: 6 minutesThe SQL Server DATEDIFF system function is a very useful function for manipulating date information in your database. In this very brief tutorial, we’ll discuss how the DATEDIFF function works and the key topics you should know when working with this function. Here is what we’ll discuss: The syntax of Continue Reading
SQL Server DATEADD System Function: Everything you need to know
Reading Time: 6 minutesMicrosoft SQL Server has several built-in system functions to help you calculate date information very easily. One of those helpful functions is called DATEADD. In this very brief tutorial, we’ll discuss everything you need to know about the DATEADD system function and give you examples of how to use it. Continue Reading
How to change a column type in SQL Server
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 Server NVARCHAR Data Type: Explained
Reading Time: 6 minutesThe NVARCHAR data type is used to store character string data within our Microsoft SQL Server databases. It’s important that you know how NVARCHAR works so that your database doesn’t waste space. In this very brief tutorial, we’ll discuss how NVARCHAR works and when you should consider using it. NVARCHAR Continue Reading