What is a table expression? Table expressions are named query expressions that represent a valid relational table. Microsoft SQL Server supports four types of table expressions: derived tables, common table expressions (CTEs), views, and inline table-valued functions (inline TVFs). Table expressions are not physically materialized anywhere; they are virtual and […]

SQL Server Table Expressions

SQL Server 2005 introduced the APPLY operator, which is very much like a join clause. APPLY allows the joining of two table expressions. The difference between join and the APPLY operator becomes evident when you have a table-valued expression on the right side and you want this table-valued expression to […]

SQL Server Apply

There is a good article at that helps you troubleshoot this error 15517 on SQL Server. I got this error when I tried to create a database diagram on one of my databases. The other databases were fine. The article is called Troubleshooting SQL Server Error 15517. I read […]

SQL Server Error 15517

This post is a continuation of the post called SQL Server Logical Query. It is based on the example in the book called T-SQL Querying by Itzik Ben-Gan published by Microsoft Press in 2015. One-To-Many This example uses two tables that have a one-to-many relationship. We have a Customers table […]

SQL Server Logical Query Example

This post describes how you can create a user-defined function in SQL Server. We will start off with a simple example that does not take any arguments in. It only returns the current date. You don’t need to actually write this yourself because SQL Server already has a function to […]

SQL Server Functions