I have already created table ABC in Kusto database , I would like to add column with default DateTime column into existing table ABC. I have tried couple of ways but not able to do it .
Even not able to add default datetime column while creating table definition , Any help here would appreciated.
Default Date time column is nothing but table column which always takes current datetime value when records inserted into to it. consider below table definition in kusto
.create table tblOleMeasurments (elr: string, track_id: long, vehicule_speed_mph: real, InsertedDate Datetime)
now here I dont want to insert any value into InsertedDate column rather it should automatically take current timestamp when record was inserted into it .
Something similar we have present in SQL Server table like below
CREATE TABLE test ( aa int, Inserteddatetime DATETIME DEFAULT GETDATE() );
there's a built-in ingestion_time()
function you can use: https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/ingestiontimefunction?pivots=Azure data explorer.
Behind the scenes, it uses a datetime column which is populated with the time records were ingested, as your questions describes.