question

CEO-8149 avatar image
0 Votes"
CEO-8149 asked ZoeHui-MSFT commented

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RyanAbbey-0701 avatar image
0 Votes"
RyanAbbey-0701 answered

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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ZoeHui-MSFT avatar image
0 Votes"
ZoeHui-MSFT answered ZoeHui-MSFT commented

Hi @CEO-8149,

You may add a new column with Derived Column using expression as below.

 (DT_DBTIMESTAMP)GETDATE()

Details you may refer below.

121015-untitled1.png

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



untitled1.png (25.0 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Do you have further question on this , could we offer more support?
If this helps on your issue, you could mark it as answer so other user with similar problem could see this easier. :)

0 Votes 0 ·