MS SQL Anomalies 3

For those who are still using ancient data types such as CHAR be carefull if you are also using REPLACE function in MS SQL servers: Let’s test VARCHAR and CHAR fields on a simple table like the following:

The output is: (version MS SQL Server 2000) As usual, Microsoft developers are full of surprises!

Deceiving MS SQL Server: UPDATE Command

First version:

It does NOT complain and it seems all right, and runs without a problem, but since I selected the records with INNER JOIN and know that there are records that must be updated, we must find another way of updating those records. The problem is our table is referring to itself and … Read moreDeceiving MS SQL Server: UPDATE Command

Faster lookup using VBA Collections

Reading records from the database and instead of using DLookup or querying the database all the time, to improve performance we can read them into a VBA collection object and refer to it in memory. Especially, if the data in particular tables are not changing at all or changing very rarely, we can use this facility and hold the data in memory while the application is running. Beware of the number of records in your table and the amount of memory it may consume.