DateTime in C++
Many years ago we had a need to manipulate the data of types "date" and "time" (DateTime in C# and Delphi/C++Builder). I have developed the corresponding class for these purposes.
|
Programming is thinking, not typing |
|
Many years ago we had a need to manipulate the data of types "date" and "time" (DateTime in C# and Delphi/C++Builder). I have developed the corresponding class for these purposes.
Let's see one simple example showing how the methods and the languages of graphical user interface (GUI) description are progressing (or regressing, it depends) during the last 15-20 years.
The primitive form description requires:

object Form1: TForm1
Left = 0
Top = 0
Caption = 'Test form'
ClientHeight = 131
ClientWidth …I had written this article initially in 2010 for SQL Server 2008 R2 but updated it recently using SQL Server 2022 (16.0).
Let's take a look on the differences between temporary tables (#table_name) and table variables (@table_name) in SQL Server.
Temporary tables are stored in the …
Clearly, an index build on only one column of the bit type is useless because the selectivity is poor (50% of a table in average). However, when a table has several columns of the bit type, the composite index may be efficient.
For the test example, we'll create a table …
The one of the most frequent asked question in database development is "How to filter the data returned by a query according to some user selected criteria?". To complete the solution with dynamic ordering see my other blog post.
For every method template I will add icons indicating corresponding advantages …
A quine is a computer program which takes no input and produces a copy of its own source code as its only output. The challenge for programmers is to write the shortest code in the given language. Here are my examples in Transact SQL and in ANSI SQL.
Note that …
There are several methods to implement the dynamic ordering of result returned by SQL query. The examples of stored procedures below use the Microsoft's demo database AdventureWorks.
USE AdventureWorks
GO
The sequence of IF..ELSE looks not so pretty but is efficient and rapid. When you …
The rand() Transact SQL function produces a sequence of same numbers in the query. For example:
SELECT rand() AS rand_value, id
FROM
( SELECT 1 AS id
UNION SELECT 2 AS id
UNION SELECT 3 AS id
) AS t1;
This query shows the following result:
rand_value id
---------------------- -----------
0,581556027773794 1
0 …How much of disk space is used by tables?
DECLARE @TableInfo TABLE (
table_name sysname,
row_count int,
reserved_size_kb nvarchar(50),
data_size_kb nvarchar(50),
index_size_kb nvarchar(50),
unused_size_kb nvarchar(50)
)
INSERT INTO @TableInfo
EXEC sp_MSforeachtable 'sp_spaceused ''?'''
UPDATE @TableInfo
SET
data_size_kb = replace(data_size_kb, 'KB', ''),
reserved_size_kb = replace(reserved_size_kb, 'KB', ''),
index_size_kb = replace(index_size_kb, 'KB', ''),
unused_size_kb …Le type "guid" (uniqueidentifier) a été introduit dans la version 7/2000 de SQL Server. Etant utilisé pour les clés primaires ce type avait apporté plusieurs avantages (et inconvénients, bien sur) in implémentation de BDD. En 2002, j'ai fait un essais de performance en comparaison les différents types des données …