Reading Time: 8 minutes One of the more tricky things I learned early in my career was how to do an UPDATE statement with a JOIN. This is a very interesting task to think about. There may be situations when we want to perform an UPDATE to the results of a JOIN query, such Continue Reading
SQL DECIMAL vs NUMERIC: What’s the difference? (THERE IS NONE)
Reading Time: 2 minutes This 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
SQL Server DECIMAL: Everything you need to know
Reading Time: 7 minutes The SQL Server DECIMAL data type is a very common data type you will see and use in your career as a database professional. It’s important for you to know how it works and the rules for setting it up. DECIMAL is, of course, ideal for when you need to Continue Reading
SQL Server ROLLBACK: Everything you need to know
Reading Time: 9 minutes In SQL Server, there are plenty of instances where you might want to undo a statement that was just ran. Maybe you wrote an UPDATE statement that modified too many rows, or maybe an INSERT statement wasn’t quite right. In these instances, it is great when the work is performed within a Continue Reading
Stored procedure with parameters: A guide for beginners
Reading Time: 11 minutes If you need to write a stored procedure within SQL Server, odds are it will be a stored procedure with parameters. It is much more common to see a stored procedure with parameters than one without parameters. It’s important you understand both input and output parameters, which we will discuss in this tutorial. I Continue Reading
SQL Server Unique Index: Everything you need to know
Reading Time: 8 minutes If you know a thing or two about Clustered indexes and Nonclustered indexes, you might be looking to “round out” the topic with an understanding of what a Unique index is. Unique indexes are a great way to enforce uniqueness in a column other than the Primary Key column. If Continue Reading
DATENAME function: Explained
Reading Time: 7 minutes The DATENAME function is a system function in Microsoft SQL Server we can use to present meaningful date information to the user. We use this function to basically spell out a specific part of a date value. For example, if we have a date of 4/1/2021, we can use DATENAME to Continue Reading
DATETIME2 Data Type: Explained
Reading Time: 7 minutes The DATETIME2 data type is one of several data types used to keep track of date and time information, obviously. Just like any other data type, there is a time and place where DATETIME2 might be the preferred type to use over other date and time types, like it’s close Continue Reading
SQL Integer Data Types – Everything you need to know
Reading Time: 6 minutes Knowing the difference between all the integer data types available to us in Microsoft SQL Server is very important when it comes to the task of designing and developing SQL Server databases. Most people don’t realize that a data type is essentially a constraint, meaning the data type you choose Continue Reading
Are you making this ROLLBACK mistake in your stored procedures?
Reading Time: 9 minutes If you read my post about the 6 rules you should know about SQL Server transactions, you should know there is one rule that can be a bit tricky. This rule centers around the idea of doing a ROLLBACK within a stored procedure. The rule is this: When you leave Continue Reading