Switch-Out a Partition in SQL Server (T-SQL)

In SQL Server, partition switching allows you to load large amounts of data in or out of a table very quickly. This saves you from having to run delete or insert statements, and can be very useful when working with large data sets.

You can use the ALTER TABLE statement to switch a partition in or out of a table.

To switch a partition out of a table, the code goes like this:

ALTER TABLE Table1
SWITCH PARTITION x TO Table2

This switches partition x from Table1 to Table2 (where x is the partition number).

Read more

12 Commonly Used SQL Operators

In SQL, an operator is a special character or keyword specifying an action that is performed on one or more expressions.

SQL operators are an integral part of SQL, and they enable us to write queries that return relevant results.

In this article, I present 12 of the most commonly used SQL operators when writing SQL queries.

Read more

SQL Operators

This article provides a list of SQL operators, and can therefore be used as cheat sheet for SQL operators.

Not all of these operators are supported across all DBMSs. If in doubt, check the documentation for your specific DBMS.

Read more

What Do I Need to Run SQL?

I get it. You’re trying to learn SQL, but they won’t even tell you the most fundamental part – what you need to run SQL!

You’ve got the SQL code… but where do you actually run it? What software program do you need before you can run your SQL query against a database?

If that’s you, all is about to be revealed!

Read more