MSSQL

The Azure SQL Serverless Trap: How a 10-Minute Cron Job Cost Me €30 in 2 Days

Many advertisements say something like “Only pay for what you use!” It sound like you can make your small app free of charge, but something can always go wrong. As I recently learned the hard way, serverless doesn’t always mean cheap. In fact, under the right conditions, it can be a massive budget burner. Here […] Read more»

Azure

Create backup of Azure SQL database

When you use Azure SQL Database, then you should understand, that it has something different from on-prem version. And you will find it only when you start to work with it. Read more»

SQL and databases

Feed uniqueidentifier field with Random GUID value in SQL

There’s a data type ‘uniqueidentifier’ in SQL. If you need to feed this field with random value, you can use NEWID(). The ‘uniqueidentifier’ value in SQL looks like this: ‘234779E5-996F-45AC-90C3-21631AF4A08D’. Read more»

SQL and databases

T-SQL tips: Replace function example

In the developer database (MS SQL Server) I had a field, in which all the values were the same. The value was “OldDoc.txt”. I wanted to make values unique and for this I wanted to add “ID” before “.txt”. Read more»

SQL and databases

Select the rows between 2 dates in MS SQL table

If you need to select the records between 2 dates in MS SQL, where the DateTime column contains both Date and Time, you can use SQL functions for WHERE clause and avoid of adding the time information like ’23:59:59.000′. Though you can do it and this way. Read more»

SQL and databases

ID numbers dramatically increased with MS SQL in Docker

I work with a WebApi project in Net.Core and MS SQL Database. MS SQL server is executed in Docker container. Suddenly I found out, that ID field value with autoincrement has increased from 2 to 1001. Read more»

SQL and databases

Dapper with PostgreSQL and MSSQL Server

Create a console app with .Net Framework 4.7.2 with Dapper and datasource in MSSQL Server or PostgreSQL. If you create this ancient app, you should only add Dapper and NPGSQL packages from Nuget. The support of MS SQL Server is already built in. The scenario for .Net Framework is from real life, several applications still […] Read more»

.Net & C#

SQL recursive query from bottom to top

The task is to build a tree in a table with parentID from bottom to top. It’s useful for generating hierarchy strings, lists or any other types. You can also create a storage procedure of this and it will make it easy to use in queries. Read more»

SQL and databases

Popular Posts