stored procedure problem

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2007
Posts: 28
Reputation: u4umang2001 is an unknown quantity at this point 
Solved Threads: 0
u4umang2001's Avatar
u4umang2001 u4umang2001 is offline Offline
Light Poster

stored procedure problem

 
0
  #1
Feb 18th, 2008
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
Thanks & Regards
Umang
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 4
Reputation: srinunarra is an unknown quantity at this point 
Solved Threads: 0
srinunarra srinunarra is offline Offline
Newbie Poster

Re: stored procedure problem

 
0
  #2
Feb 19th, 2008
Hi,

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

exec adding 10

Regards,
SrinivasaRao.Narra
Kongapadu.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC