Skip to content
Advertisement

Update unique value (String) for each insert when doing multiple insert

I am performing insert operation like follow on Microsoft SQL Server Management Studio:

This insert is supposed to make few hundreds of insert.

But here I want to insert scode like C000512, C000513, C000514 ….

and C000511 being the latest scode entry previously present in contacts.

How do I make this SCODE insert unique for each insert?

Previously I have tried

or:

Or also by creating a variable. But SCODE wasn’t updating.

Any suggestions how I can make this work?

Advertisement

Answer

Put it into a transaction, row_number new rows.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement