Read more about the article Identity columns that are about to overflow
Microsoft SQL Server

Identity columns that are about to overflow

Identity columns are widely used as primary key columns in SQL Server tables. They can be one of the data types TINYINT, SMALLINT, INT, BIGINT, NUMERIC or DECIMAL. Each of these data types has an upper limit and when that upper limit is reached, an error is raised and further inserts into the table are impossible.

(more…)

Continue ReadingIdentity columns that are about to overflow

Toggl Time entries to SQL Server

Toggl is a very simple to use cloud based time tracking application. Time entries on projects and clients can be submitted through the web page or through mobile and desktop applications. Time spent by the team can be viewed in the different reports that can be accessed via their web page. There is a free version that handles much of the time tracking needs, and there are more advanced paid versions as well.

If you want to integrate the information stored at Toggl with your own enviromnent, you can use their API. One way is to download time entries to your own SQL Server database, which is the method I’ll present here.

(more…)

Continue ReadingToggl Time entries to SQL Server
Read more about the article sys.dm_exec_cached_plans
Microsoft SQL Server

sys.dm_exec_cached_plans

The dynamic management view sys.dm_exec_cached_plans returns information on query plans currently in memory. This information can be useful for a lot of reasons: checking total memory allowed for cached plans, which plans aren’t getting reused, searching for certain query plan operators (for instance, scans), which query plans are high memory consumers etc.

(more…)

Continue Readingsys.dm_exec_cached_plans
Read more about the article Calculating Earned Premium in SQL Server
Microsoft SQL Server

Calculating Earned Premium in SQL Server

In most business, when a company receives payment for a sold product, that payment can be considered an income. But to an insurance company, only the part of the premium that has been earned (Earned Premium) can be considered as income. The rest is the unearned premium, or the premium reserve. How the premium is earned vary between insurance products and industries. Here I’ll show a couple of methods and how they are calculated in SQL Server.

(more…)

Continue ReadingCalculating Earned Premium in SQL Server
Read more about the article Mass editing of SQL Server objects
Microsoft SQL Server

Mass editing of SQL Server objects

Ever had the need to replace a piece of code in multiple SQL Server objects (Stored Procedure, Trigger, Function or Views)? Here’s a method to search for a string in all objects, replace it with some other code, and to finally script all changes. In other words, a method for mass editing SQL Server objects.

(more…)

Continue ReadingMass editing of SQL Server objects