Autogenerate insert value like excel

MOHD SHAH BANI MOHD ZAHIR 21 Reputation points
2021-07-18T14:01:23.88+00:00

115642-image.png

Hi,

I have 8 group name to insert to 1000 row repeatably. How to do it in Data Services to generate automatically the 5 username insert to 1000 row ?

thanks.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,799 questions
0 comments No comments
{count} votes

Accepted answer
  1. Erland Sommarskog 111.2K Reputation points MVP
    2021-07-18T15:41:20.953+00:00

    Not sure what you mean with Data Services, but there are so many products in the Data Platform sphere, I can't keep track of them all.

    In plain SQL query you can do:

    SELECT BIL, POSKOD, STATUS, KETERANGAN, LOKASI, 
            row_number() OVER(ORDER BY BIL) / % 8 + 1
    FROM  tbl
    

    The row_number function numbers the rows ordered by what you specify in the ORDER BY clause. % is the modulus operator.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.