Published on

September 29, 2011

Exploring SQL Server Concepts: Attribute Propagation and the Rules Editor

SQL Server is a powerful database management system that offers a wide range of features and tools to simplify application development tasks. In this article, we will explore two key concepts in SQL Server: attribute propagation and the rules editor.

Attribute Propagation

Attribute propagation is a functionality introduced in the latest release of expressor Studio. It aims to minimize the amount of data mapping and coding required in transformations. The idea behind attribute propagation is that most values in a transformation are either copied from the input record to the output record without any changes or dropped from the output record. Attribute propagation performs these operations transparently, eliminating the need for manual coding.

Let’s consider an example to understand attribute propagation better. Imagine a company that wants to give a 5% salary increase to employees whose tenure with the company started before January 1, 1995. To achieve this, we can use three operators in SQL Server: a SQL Query operator to select the qualified employees from a database table, a Transform operator to carry out the salary calculation, and a Write Table operator to write the modified record back to the database table.

Within the Transform operator, the rules editor comes into play. The rules editor provides a graphical coding tool that allows developers to manipulate the values that require modification. In our example, we can use the rules editor to apply the salary increase and round the salaries to whole dollars.

The Rules Editor

The rules editor in expressor Studio simplifies the development process by providing a user-friendly interface to define rules for attribute manipulation. In the left-hand panel of the rules editor, you can see a listing of the attributes in each incoming record. These attributes are identical to the table column names, but expressor allows you to easily rename them if desired.

The right-hand panel of the rules editor shows the effect of attribute propagation. Each incoming attribute is automatically transferred to the outgoing record. The right-facing arrow before each attribute name indicates that the attribute will be initialized automatically, without the need for coding.

To modify the value assigned to the outgoing record’s SALARY attribute, you can simply drag a connection between the input and output attributes. An expression rule is displayed, which by default transfers the incoming value to the output. You can easily modify this default code to apply the salary increase and perform any necessary rounding.

But what if your processing logic is more complex? For example, you may want to give the raise only to employees whose commission percentage is smaller than 0.35%. In such cases, you can replace the expression rule with a function rule, which gives you full access to the underlying code and allows you to enrich your logic using helper functions.

The rules editor offers various rule types, including expression rules, function rules, lookup expression rules, lookup function rules, aggregate expression rules, and aggregate function rules. These rule types are available in different operators, such as the Transform operator, Join operator, and Aggregate operator.

Conclusion

Attribute propagation and the rules editor in SQL Server provide a high level of support when your applications require coding. These features simplify the development process by minimizing the amount of manual mapping and coding needed. With attribute propagation, you can focus on manipulating the values that require modification, while the rules editor offers a user-friendly interface to define rules for attribute manipulation.

SQL Server continues to innovate and provide developers with powerful tools to streamline application development tasks. The expressor Studio, with its attribute propagation and rules editor, is a testament to this commitment. To explore these features further, you can download the expressor Studio tool from their website.

Click to rate this post!
[Total: 0 Average: 0]

Let's work together

Send us a message or book free introductory meeting with us using button below.