SQL Server SSIS: ReplaceNull
One of widespread problems in SSIS packages is to replace NULL values with some specific value. Unfortunately, before it was not a simple task as Integration Services didn’t have the operator similar to ISNULL () in T-SQL. To be more exact, there was such an operator, but it works in a slightly different way.
SSIS ISNULL function returns the result in the form of a logical expression, depending on whether the expression value is NULL.
Therefore to cope with the task in which the main requirement was to process NULL values and display 0 (zero) instead of them the following script was used:
(ISNULL(OpPriceAir) ? (DT_CY)0 : OpPriceAir) + (ISNULL(OpPriceExt) ? (DT_CY)0 : OpPriceExt)
The situation changed when SQL Server 2012 was released: a new operator REPLACENULL appeared in SSIS. And now the same problem is solved as follows:
REPLACENULL(OpPriceAir,0) + REPLACENULL(OpPriceExt,0)
Utilizing given approach each client get his own database. In such case every client`s data stays isolated from others. It simplifies backing up the data, installing new clients but causes higher cost of maintenance.
MoreSubject recursion is well covered in the literature, but, nevertheless, the problem of output “tree” does not mean the client and SQL Server many baffled. So, put the problem: there is a table with the name and record id field indicating the parent identifier. Immediately fill in this table, some sort of test data:
MoreIn our time of greatest prevalence of databases were relational databases, which are the main targets of the tables and the relationships between them. Tables can solve most problems for data storage and manipulation. But in the real world entity requiring storage is not always presented in a tabular form. One of these very common types of data structures other than the table is a tree structure, where each data element is the parent and the offspring. An example of such a structure may be the structure of state enterprises, which is headed by the director (the root of the tree), his deputies, heads of departments from which are subject to certain deputies, employees of departments, which are subject to the rulers.
MoreSubscribe to our blog
Utilizing given approach each client get his own database. In such case every client`s data stays isolated from others. It simplifies backing up the data, installing new clients but causes higher cost of maintenance.
Subject recursion is well covered in the literature, but, nevertheless, the problem of output “tree” does not mean the client and SQL Server many baffled. So, put the problem: there is a table with the name and record id field indicating the parent identifier. Immediately fill in this table, some sort of test data:
Discuss your project with us