Reading Time: 2 minutesSometimes, you want to execute certain SQL code only if you know that a specific column exists within a table. There is an extremely simple way to check if a column exists within a table in SQL Server: Use the COL_LENGTH system function! The syntax of the COL_LENGTH system function Continue Reading
Data Definition Language
SQL IF EXISTS Decision Structure: Explained with Examples
Reading Time: 6 minutesThe SQL IF EXISTS tool is great to know for managing the flow of control of your SQL code. In this very brief tutorial, we’ll discuss everything you need to know about the IF EXISTS decision structure in SQL Server. We’ll discuss these topics: What is the SQL IF EXISTS Continue Reading
SQL Server GO: Explained with Examples
Reading Time: 6 minutesThe SQL Server GO keyword is extremely common when querying and developing SQL Server databases. It is important that you understand how it works if you regularly create objects (such as tables, stored procedures, views, etc.) in a SQL Server database. In this very brief tutorial, we will discuss everything 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 Default Constraint: A Guide for Beginners
Reading Time: 6 minutesIn Microsoft SQL Server, one of the things we should always keep in mind is the integrity of our data. One of the best ways to maintain data integrity is to introduce constraints into our tables. Constraints are a great way to restrict the data that can be inserted into 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
SQL Server Custom Data type: A How-To Guide
Reading Time: 5 minutesOne of the more interesting things you can do within Microsoft SQL Server is create your own custom data type. The process is actually very simple. In this very brief tutorial, we’re going to learn how to create a custom data type in SQL Server. We’ll discuss these topics: The Continue Reading
Second Normal Form: A Beginner’s Guide
Reading Time: 9 minutesNormalization is a very important process of designing tables in such a way that they maintain data integrity and reduce data redundancy. We were introduced to the concept of Normalization in our previous tutorial about First Normal Form. If you missed that tutorial, definitely check it out! In this tutorial, 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