Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to increase a value by one

Status
Not open for further replies.

davikokar

Technical User
May 13, 2004
523
IT
hallo,

I have a table where in one column there are int values. I would like (given the ID of the row) to increase the value by one. Is this possible with one Stored Procedure ? Or do I have to select it, add one, and then update ?

thanks
 
update myTable set ID = ID+1 where ID >=@ID -- this would increase all IDs in the table by 1 starting from the given ID
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top