Add Batch data (sql)

Add Batch data (sql)

DECLARE @i int, @ x int, @ y int, @ z int ----> define variables X, Y, Z
SELECT @ I = 0,. 1 @ X =, Y =. 1 @, @. 1 = Z - -> assigned to a variable, i is the cycle conditions, here 0
the while @i <. 3 ----> i plus 1 after each cycle, until i is greater than 10
the begin ----> begin SQL
the INSERT the INTO timee ([time1], [TIME2], [time3])
the SELECT time1, @ Y, Z @ from timee WHERE id = 1 ----> id = the value of this data the time1 1, and the value of the variable, Fu to insert statements.
SELECT @ i = @ i + 1 , @ x = @ x + 1, @ y = @ y + 2, @ z = @ z + 3 ----> sql executed, increments the variable
END

Guess you like

Origin www.cnblogs.com/BrightS-Li/p/11759333.html