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 Reactions
1,258 Views
Posts: 18
 VK
Admin
Topic starter
(@vinodkrsetty5895)
Active Member
Joined: 6 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
Posts: 46
(@Lavanya)
Joined: 6 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<=@End

Begin

Pring @start

Set @Start = @Start+1
End


Reply

Leave a reply

Author Name

Author Email

Title *

 
Preview 0 Revisions Saved
Share: