Go through NULL

Many people know and use the built-in function ISNULL (X, Y), which replaces the first argument with the second argument if it is (first) NULL. Less useful is the inverse built-in function NULLIF (X, Y), which returns NULL if the first argument is equal to the second argument. The combination of these two functions avoids the use of IF-ELSE or CASE-WHEN constructions, which makes the code more compact. If it's interesting to see a couple of examples - welcome to the cat.
 
 
 
For example, here is the code that outputs 10 random integers in the range from 1 to 3? and the nearest value to the output ...
+ 0 -

How to copy data sources to the IDE on the IntelliJ

How to copy data sources to the IDE on the IntelliJplatform.Hello! In this tutorial, consider a few popular scenarios.  - Copying the data source within a single project. - A common data source for different projects within the same IDE. - Copy the data source to another IDE, to another computer, to another galaxy.  export settings . But you do not always want to transfer all the settings, and the data sources - global ones, too, are not always :)  So it will be useful to know that the data source can be copied: on the shortcut menu, selectDatabase tools → Copy data source to clipboard. This will work with several at once.    The clipboard gets the ...
+ 0 -

[Перевод]Handling errors and transactions in SQL Server. Part 1. Error handling - quick start

Hello, Habr! I present to your attention the translation of article "Error and Transaction Handling in SQL Server. Part One - Jumpstart Error Handling » by Erland Sommarskog.
 
 

1. Introduction


 
This article is the first in a series of three articles devoted to error handling and transactions in SQL Server. Its goal is to give you a quick start in the topic of error handling, showing a basic example that fits most of your code. This part is written in reference to an inexperienced reader, and for this reason I deliberately keep silent about many details. At the moment, the task is to ...[/h]
+ 0 -

Decoding of saved passwords in MS SQL Server

Decoding of saved passwords in MS SQL ServerLong ago, in a remote galaxy, the previous administrator of your SQL Server set the linked server in it, using a specially created account with a generated password for this purpose. Now you need to do something with this link, for example, transfer it to another SQL Server; but just do not do it, because nobody knows the password from that account. Common situation?
 
 
Although MSSQL does not store passwords for its accounts, and only stores their hashes, it will not work with linked servers, because you need to have an open password before you can successfully authenticate to an external server...
+ 0 -

Database and DBMS research using T-SQL

Foreword


 
Greetings again, dear reader Habra!
 
When your realized ideas, experience, as well as all the information that does not give rest, you make out in the publication, sooner or later a logical point comes to the entire previously written information flow. This article will be different from all previously published by me my looseness and freer style of text presentation, and also she will finish the presentation of all my accumulated experience on MS SQL Server.
 
 
This article is in addition to article Let's explore the databases using T-SQL , and also briefly tells ...[/h]
+ 0 -

Three aspects of optimization (DB and PO)

Foreword


 
Quite often, users, developers, administrators, and so on of MS SQL Server DBMS encounter problems with DB or DBMS performance in general.
 
 
In this article, we will give general recommendations on how to optimize both the database and the entire database. Also, the main recommendations for the interaction of the .NET application and MS SQL Server will be given. Examples of solutions will be given for most of the recommendations below.
 
 
In this article, optimization of hardware resources, the OS itself and the use of various embedded features for the DBMS and OS as a whole will ...[/h]
+ 0 -