Use a sequence? On submission, your process queries the sequence for the next number and you assign that to all your incoming rows. Alternatively, if there's no chance that two processes will submit at the same time, a timestamp should suffice
CREATING A RECORD FOR A BATCH OF ITEMS IN SQL
Hello,
Please is there a way I can generate database ID for a batch of items?
What I mean is that, if for example I have these data:
Name School Department
John Havard Info Tech
David Liverpool Econometrics
Desmond Boston Mech Engin
I want at the click of submission of these data, they should be treated as ONE record and assigned only ONE identity number automatically by the system. I know it is possible but don't know how. Please I need your contribution if you have a clue.
SQL Server Integration Services
2 answers
Sort by: Most helpful
-
-
ZoeHui-MSFT 41,536 Reputation points2021-08-06T03:48:20.23+00:00 Hi @CEO ,
You may add a new column with Derived Column using expression as below.
(DT_DBTIMESTAMP)GETDATE()Details you may refer below.
If I misunderstand your issue, please incorrect me and give us more message.
Regards,
Zoe
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Hot issues October