Forum

How to write a proc...
 
Share:
Notifications
Clear all

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

2 Posts
2 Users
0 Likes
300 Views
VK
Posts: 18
 VK
Topic starter
(@vinodkrsetty5895)
Active Member
Joined: 2 years 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
Guest
(@Lavanya)
Eminent Member
Joined: 2 years 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

Leave a reply

Author Name

Author Email

Title *

 
Preview 0 Revisions Saved
Share: