Sleep well

How many ways to sleep a thread do you know? Usually you need to sleep a thread in a loop when you execute some repeatable operation (checking results every 5 seconds, for example). So, you need to stop this loop for a period of time.

Soft API contract

Working with some API you expect that this API will stay stable and return the same type of result from call to call. But, sometimes it does not work this way. In the article I will tell about integration with SOAP-service and volatile contracts. To describe the problem, I need […]

Null or NotNull

This topic is related to this question on StackOverflow. Let’s discover, what are CanBeNull or NotNull attributes? How they work? These attributes provided by JetBrains ReSharper Annotations and help you to find errors in your code with ReSharper.

Who can foreach

This post is about popular question «What collection can be used in foearch statement?». If you think that correct answer is IEnumerable, read this post ? First of all let’s read docs from Microsoft: The foreach statement repeats a group of embedded statements for each element in an array or an object […]

Varieties of properties

Property is a flexible mechanism to access private fields (set and get value) and implement computations. Now we have different ways for implementing properties — from classic with backing field and get-set keywords to modern lambda-style. Let’s find is there any difference between all these properties. This article is based […]

Useful Constraints

Usually we use constraints to specify the allowable values for the columns in tables. And it works perfect! But beyond that, constraints help query analizer to generate more effective query plans. How it works? Read below. There is an opinion «Give MS SQL Server all information you know about data […]

Неизвестный T-SQL

Несколько редко используемых, но вполне полезных функций MSSQL. Если вы никогда не слышали о функциях CHOOSE, ROW_NUMBER, RANK, DENSE_RANK, FIRST_VALUE, LAST_VALUE, LAG, LEAD, PERCENTILE_CONT и PERCENTILE_DISC, то ниже вы узнаете, какие полезные вещи можно сделать их помощью. Так же, я покажу несколько примеров использования выражений OVER и PARTITION BY в […]

О пользе ограничений

Как мы привыкли, ограничения (CONSTRAINT) — способ указания допустимых значений для столбцов в таблице. С этой своей функцией они справляются на отлично! Но помимо этого, ограничения так же помогают анализатору запросов генерировать более эффективный план выполнения. Как именно? Читайте ниже. Есть такое мнение «Дайте MS SQL максимальную информацию о данных, […]