954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

stored procedure problem

Hi All,

i have table with some fields. one of them is "ID".
now i want to update ID by a given number.

suppose i have 5 rows and the ID are 1,2,3,4,5.
now i want that i should pass a parameter/number to the stored procedure
let it 10
then the table should contain ID as 11,12,13,14,15 after updation.
means given number should be added to all the IDs in the table.

how can i do this using stored procedure???


THANKS IN ADVANCE

u4umang2001
Light Poster
28 posts since Nov 2007
Reputation Points: 10
Solved Threads: 0
 

Hi,

Create procedure adding
@number int
as
update tablename set id=id+@number

exec adding 10

Regards,
SrinivasaRao.Narra
Kongapadu.

srinunarra
Newbie Poster
4 posts since Feb 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You