I have a table of healthcare claims data for which I would like to have a unique identifier for each row. I have acheived this in the past by creating a temporary table with an identity column and then inserting those rows into my final table. I use a variable to find the maximum value in the destination table. The data type in the final table, in this example, is bigint.
I will receive claims data on a recurring basis from various clients and I am creating a procedure to add the new claims to an existing table.
I was wondering if I could directly insert the claims into the destination table which will have an identity column. I tried to use NEWID() and that did not work.
Here is a sample of my insert statement:
Insert Into DEV..REBATEPRIMARY