I have the following table:
RecordID
Name
Col1
Col2
....
ColN
The RecordID
is BIGINT PRIMARY KEY CLUSTERED IDENTITY(1,1)
and RecordID
and Name
are initialized. The other columns are NULLs.
I have a function which returns information about the other columns by Name
.
To initialized my table I use the following algorithm:
- Create a LOOP
- Get a row, select its
Name
value - Execute the function using the selected name, and store its result in temp variables
- Insert the temp variables in the table
- Move to the next record
Is there a way to do this without looping?