Ich habe einen Tisch wie:
CREATE TABLE grid_rows(
[grid_row_id] [int] NOT NULL,
[grid_column_id] [smallint] NOT NULL,
[decimal_val] [decimal](18, 6) NULL,
[datetime_val] [datetime] NULL,
[integer_val] [int] NULL,
[string_val] [varchar](1024) NULL
)
Diese Tabelle hat einige 1,037,560 rows
exec sp_spaceused "grid_rows" gives:
rows reserved data
1,037,560 461,768KB 302,648KB`
Nach dem Ändern der Genauigkeit von (18, 6) auf (24,6) dh
ALTER TABLE grid_rows ALTER COLUMN decimal_val decimal(24, 6)
exec sp_spaceused "grid_rows" gives:
rows reserved data
1,037,560 641,352KB 560,832KB
Der von decimal(18,6)is 9 bytesund dem von (24, 6)is zugewiesene Speicherplatz 13 bytes. MSDN-Referenz
The reserved space has increased by around 179,584 KB and data space by 260,000KB. Shouldn't it be increased by 1,037,560 * 4/1024 = 4052 KB
decimal(24, 6)gerade von Anfang an : für eine Tabelle mit 1024 Zeilen, ich bin immer 48KB mit decimal(18, 6), 56KB mit decimal(24, 6)und 72KB mit decimal(18, 6) then alter to decimal(24, 6). Ich habe jedoch keine Erklärung dafür.
