Tuesday, 1 July 2014

Generate Random Numeric in sql server

 DECLARE @intFlag INT
declare @rand numeric(18,0)
Set @intFlag = 1

WHILE (@intFlag <=1000)
BEGIN
select @rand= convert(numeric(12,0),rand() * 89999999) + 10000000SET @intFlag = @intFlag + 1
print @rand
END



Result-


No comments:

Post a Comment

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...