Forum

How to write a proc...
 
Notifications
Clear all

How to write a procedure to print numbers from 1 to 100?


VK
Posts: 17
 VK
Topic starter
(@vinodkrsetty5895)
Active Member
Joined: 1 year ago

Can anyone help me?

I want to write a procedure to print numbers from 1 to 100. How can I achieve this? 

1 Reply
Lavanya
Posts: 47
 Lavanya
(@Lavanya)
Joined: 1 year ago

You can use the below query to print numbers from 1 to 100

Declare @ Start Int
Declare @ End Int

Set @Start =1
Set @End =100

While @Start<[email protected]

Begin

Pring @start

Set @Start = @Start+1
End

Reply
Share: