Skip to content
Simple SQL Tutorials

Simple SQL Tutorials

Your guide to querying and developing SQL Server databases

  • Home
  • Tutorials
    • The Basics
    • Transactions
    • Normalization
    • Querying data
    • Developing Databases
    • SQL Questions
    • Identity Property
    • JOIN
    • Data Types
    • Stored Procedures
    • Window functions
    • Data Definition Language
    • Views
    • Constraints
    • Set Operators
    • Table Expressions
    • Error Handling
    • Functions
    • Indexes
    • Triggers
  • Products
  • Contact
  • Privacy Policy
  • About

How to check if a column exists in SQL Server

Posted on March 28, 2022August 16, 2023 by Josh D
How to check if a column exists in SQL Server

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

Posted In Data Definition Language, SQL Questions

Don’t make this mistake when calling your SQL Stored Procedures!

Posted on March 28, 2022August 16, 2023 by Josh D
Don’t make this mistake when calling your SQL Stored Procedures!

Reading Time: 3 minutesStored Procedures are complicated beasts in Microsoft SQL Server. There are many quirks you should be aware of when creating and calling them. In this very brief tutorial, we’ll talk about one of those wacky rules. Take a look at the following Customers and ContactInfo tables: We have a stored Continue Reading

Posted In SQL Questions, Stored Procedures

SQL Server IS NULL: Why can’t I just use “= NULL”?

Posted on March 21, 2022August 16, 2023 by Josh D
SQL Server IS NULL: Why can’t I just use “= NULL”?

Reading Time: 4 minutesThe IS NULL predicate is a very useful thing to know when it comes to querying data and working with columns containing NULL. In this very brief tutorial, we’ll talk about why you need to use IS NULL instead of something like “= NULL” when checking if a value contains Continue Reading

Posted In SQL Questions

SQL IF EXISTS Decision Structure: Explained with Examples

Posted on March 21, 2022August 16, 2023 by Josh D
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

Posted In Data Definition Language, The Basics

CROSS JOIN in SQL Server: Explained for Beginners

Posted on March 14, 2022August 16, 2023 by Josh D
CROSS JOIN in SQL Server: Explained for Beginners

Reading Time: 4 minutesKnowing how JOIN operations work in SQL Server is extremely important. I would say most of the queries you will ever right in your career as a database professional will involve some kind of JOIN operation. The INNER and LEFT JOINS are the most common, but it’s also important to Continue Reading

Posted In JOIN, Querying data

How to get the data type of a return value in SQL Server

Posted on March 14, 2022August 16, 2023 by Josh D
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

Posted In Data Types, SQL Questions

How to create a table variable in SQL Server

Posted on March 7, 2022August 16, 2023 by Josh D
How to create a table variable in SQL Server

Reading Time: 4 minutesIn this very brief tutorial, we’ll discuss how you can create a table variable in Microsoft SQL Server. Knowing how to create a SQL Server table variable can be very useful when querying data in a database. It is very simple, and there are only a few rules you need Continue Reading

Posted In SQL Questions, The Basics

SQL Server GO: Explained with Examples

Posted on March 7, 2022August 16, 2023 by Josh D
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

Posted In Data Definition Language, The Basics

SQL Server EXISTS: Explained for Beginners

Posted on February 28, 2022August 16, 2023 by Josh D
SQL Server EXISTS: Explained for Beginners

Reading Time: 8 minutesThe SQL Server EXISTS predicate is a very handy tool we can use when querying SQL Server databases. Do you need to know how EXISTS works? You’ve come to the right place! In this very brief tutorial, we’ll discuss how the EXISTS predicate works and provide examples of how to Continue Reading

Posted In Querying data

Correlated Subqueries: A Beginner’s Guide with Examples

Posted on February 28, 2022August 16, 2023 by Josh D
Correlated Subqueries: A Beginner’s Guide with Examples

Reading Time: 8 minutesThere are many very helpful querying tools available to us in Microsoft SQL Server. One of the more complicated querying tools to understand is correlated subqueries. If you are new to SQL Server, I would understand if you simply don’t “get” correlated subqueries. They are a bit strange to wrap Continue Reading

Posted In Querying data

Posts pagination

Previous 1 … 6 7 8 … 16 Next

Tutorial Categories

Navigation:

Home » Page 7

Sign up for our newsletter!

Recent Posts

  • “Why should I save my query as a View instead of a .SQL file?” Answered!
  • SQL Server DELETE vs. TRUNCATE: What’s the difference?
  • SQL Server COALESCE System Function: How It Works
  • Can we create indexes in table variables? YES WE CAN!
  • SQL Server WINDOW Clause: Explained!
Copyright All rights reserved | Theme: Flash Blog by Unitedtheme.
SimpleSQLTutorials.com uses cookies to provide the best experience on our website through tailored advertising. By clicking Accept, you agree to our use of cookies.AcceptPrivacy policy