Is there a way to import a table and at that moment include an incremental primary key
I am importing a flat file, but I would like that SQL Server adds it an incremental primary key.
Is there a way, to avoid doing this:
- CREATE TEMPORAL TABLE
- INSERT ALL DATA TO A TEMPORAL TABLE
- ALTER TEMPORAL TABLE AND ADD IT
PRIMARY KEY;
I guess doing this costs lots of time…
Like this:
But I would recommend investigating your particular problem and probably solving it using the ranking functions.