In this short article I will introduce the possibility to run a sql script outside of SQL management studio using SQL server command line utility (sqlcmd for short). This...
What about upgrading GROUP BY clause by use of useful commands? GROUP BY is used in a clause with aggregate operations. When it is used, aggregation happens throughout all...
What I have here today is a article for beginners. It will be full of sql query examples. We will start from the most basic ones and continue up....
I must say right from the beginning that even though this process is possible, I do not recommend it (but I will show it to you anyway) :). Launching...
Operator UNION ALL in SQL makes it possible to unify 2 query results and does not remove duplicities in queries. Operator returns records of both queries with no regard...
UNION operator makes it possible to connect 2 results of query and remove all existing duplicities in them. In other words, operator actually performs DISTINCT in final unification of...
SUBSTRING function is used in sql to select part of text string in text. This function belongs to the group of text functions – string functions. I created a...
T-SQL command IF is used to control flow of code mainly in operations where we somehow influence db (DDL, DML operations) – for example procedures. You can mix it...
This article follows post in which I offered overview of Data types in SQL Server (more in SQL Data types – Overview ). You can find list of all...
I will follow the previous article on Data types. I will go through numeral data types and their properties. Thanks to correct data type selection you may be able...
All columns, variables or terms in SQL Server have their defined data types. These data types define of what type are the values which can be contained in given...
IN operator in t-sql is used in cases where we need to specify a condition e.g in WHERE clause to multiple discrete values at once. It is similar to...
This operator is used in SQL whenever it is needed to prove if certain value belongs to some range. This operator is used together with “AND” command which defines...
What we call a transaction in SQL is logical set or sequence of operations which belong to this transaction. SQL Transactions can be used if we perform some changes...
SQL COUNT function belongs to Aggregate functions and it is one of the most easy-to-use and also most used functions of SQL. It enables user to count rows in...
EXISTS is a T-SQL operator which can be used to test existence of a result in subquery. Based on that it can perform query or some task. Sql EXISTS...
REPLACE function is used to replace text string or its parts. It belongs to the category of string functions. I created big overview of T-SQL functions some time ago...
SQL CTE or so called Common table expression is simply put a temporary table (or better said it is a result set) in form of an expression. We can...
We can add a column to the table in two ways. First is using sql server management studio graphical interface. Second one is using SQL command ADD COLUMN. T-SQL...