sqlserver中定义一个变量,并给该变量赋一个随机值
declare @num int SELECT @num= (cast(rand() * (10) AS int) + 1)
表示给@num附上一个1-10的随机数