Equal Action to Identical Databases

Category: IT, Transact-SQL Tags: , , , Comments: 0

If I administer 345 identical databases I can do equal action to all of them (or some of them) easy by selecting the names of the databases, generate dynamic code, execute it and select the result and the errors (is any).

SELECT * or SELECT [Column Name] in IF statement in MS SQL Server

Category: IT, MS SQL Server, Transact-SQL Tags: , , Comments: 1

When we decide how to manipulate the data, we use IF statement verification. For example if we export information about merchant sales, we have two common groups of merchants – these we scan (with serial numbers) and these we don’t scan. For both of them we use two BEGIN… END blocks. To verify the type [...]

DENSE_RANK() function in MS SQL Server

Category: IT, MS SQL Server, Transact-SQL Tags: , , , Comments: 0

As we can read in Books Online in SQL Server
Ranking functions return a ranking value for each row in a partition. Depending on the function that is used, some rows might receive the same value as other rows. Ranking functions are nondeterministic.
I have created simple example for usage of the Ranking function DENSE_RANK().

The difference between WHERE and HAVING filters in SQL Server

Category: IT, MS SQL Server, Transact-SQL Tags: , Comments: 0

The difference between WHERE and HAVING filters in Transact-SQL queries is that WHERE clause is a filter of all the data, while HAVING filters the GROUP BY data. I’ve prepared a simple example.