SQL AS: Usage, Examples, and How it Can Benefit You Best

What is the AS statement in SQL? The AS keyword in SQL is used to create a temporary alias for a table or column. This alias can be used instead of the name in the SELECT statement.

The SQL language has three different ways of naming things: identifiers, table aliases, and column aliases. These are just nicknames we give things so they’re easier to talk about and work with. A good example of this would be your email address. It may be anything you want it to be. However, many people choose to use their first initial and last name instead of full names, so that they’re easier to find.

CodingSight - SQL AS Statement
Read More

Dynamic SQL Execution in SQL Server

Dynamic SQL is a statement constructed and executed at runtime, usually containing dynamically generated SQL string parts, input parameters, or both.

Various methods are available to construct and run dynamically generated SQL commands. The current article is going to explore them, define their positive and negative aspects, and demonstrate practical approaches to optimize queries in some frequent scenarios.

We use two ways to execute dynamic SQL: EXEC command and sp_executesql stored procedure.

CodingSight - Dynamic SQL Execution in SQL Server
Read More