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 SQLServerCentral.com 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

The right() function returns the right part of a character string with the specified number of characters. It starts on the right side and returns the number of characters you specify. If you string was ‘123456789’ and you specified 3, you would get 789 returned. If you specified 4, you […]

SQL Server right() function with cast()

There is a difference between the SQL keyword UNION and UNION ALL. To show the difference we will look at some queries here. In this example, we don’t use a database. We Don’t need to. Using some constants we will first use UNION ALL and we get the results we […]


As mentioned earlier, the Transact-SQL statements have three categories: DDL statements, DCL statements, and DML statements. Each of the commands in these categories include keywords and parameters that can be used to create, modify, and query SQL Server 2014 databases and tables. The three types are: Data Definition Language (DDL) […]

SQL Server T-SQL Statements