Avoiding errors concatenating fields with numerical values in SQL Server

concatenate stringsThe operator to concatenate in SQL Server is '+', but this operator is also used to add values.

 

Being the same operator for both, the query analyzer makes a concatenation or a sum based on the type of data fields being treated. If the fields are of 'string' type, the operator concatenate, and if it has numeric fields, two integers, for example, it add the two values.

Tips for UPSERT or update using insert in SQL Server

Merge SQL

In many cases, especially in ETL processes or data loading to a data warehouse, for example, we would rather use a single sentence or the checking of the existence of a register and its updating. If register doesn't exist we would want to insert it. This combination has been nicknamed UPSERT, although in SQL there is a specific statement to make it, which is MERGE.

Translation of terminology Oracle - DB2 LUW

With 9.7 DB2 LUW version, IBM makes a nod to all Oracle DBAs, much more numerous in the DB2 market.

For this reason, 9.7 version has introduced Oracle compatibility modes that let you perform tasks in DB2 with the ease and knowledge that all Oracle DBAs have. However, it is important to know the terminology's translation between Oracle and DB2 if you intend to get into the DB2 world.

In this first article, I relate a number of items from which this introduction is simple and can be read DB2 documentation easily, including general terminology, updates, utilities, and views.

 

Four questions to identify a developer with no knowledge of database

I leave here this link to a page where a small test posed to do in job interviews for database developers. Here this kind of test I do not think the style is much in a job interview, but more than one entry into the development department should evaluate its knowledge with a similar test. More than anything to avoid cracks, maximum connections, table layouts if primary keys, etc...

 

Oracle10g: Manual standby database (initial approach)

An Oracle database in Standby is an exact copy of an operational database on a remote server, used as a backup, and copy for reference, disaster recovery, etc..

A database in the Standby mode is more than a normal backup because it can be put into production disaster in less time than if we had to restore a copy (either from a simple rman or export).Restore a copy from file takes time, and during this period the system is unavailable. With an additional database in standby mode there is nothing (or almost nothing to restore) in case of disaster. Within minutes, allowing the change is continuity of service. It offers the performance advantages of a cluster or safety of the mirror but the ratio of costs versus benefits and leave time seems right to me.

From a global perspective:

Oracle 10g: Possible optimization in massive data dump

In batch runs to make a massive data dump into the same table using an INSERT or UPDATE for register within a block, the process can be optimized with the use of parameters (if client supports it) or if we use ODBC with bind variables.
Recall the steps taken by Oracle to process a query:
1) Sintactic Validation 
2) Semantic Validation
3) Optimization 
4) Generation of the QEP (Query Execution Plan)
5) Implementation of the QEP (Query Execution Plan)
Sentences can pick up the parameters by value (where salary > 1000) or once the sentence is compiled using Bind Variables (where salary>: b1). The advantage of the second option is that Oracle compile the sentence only one-time and reuses the compiled code for each of the values for the parameters.
But we must be aware because in the latter case because Oracle can't calculate the degree of selectivity of a query and, instead, apply a degree of selectivity by default (associated with each type of operation), which can give in wrong decisions.