Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
ALTER PROCEDURE dbo.update_data
	@user_id numeric(18,0),
	@name1 varchar(50),
	@address varchar(50),
	@mob varchar(50),
	@city varchar(50),
	@emailid varchar(50),
	@username varchar(50),
	@password varchar(50),
	@log_id numeric(18,0)
AS


BEGIN    
  Begin Transaction


	begin


	UPDATE    [user.]
	SET name1 = @name1,
		address = @address,
	    mob = @mob,
	    city = @city,
	    emailid = @emailid
	    
	    
		WHERE (user_id = @user_id)
	
SELECT     log_id
FROM         [user.]
WHERE     (user_id = @user_id)
	end


	begin
	UPDATE    login
	SET              username = @username, password = @password
	WHERE     (log_id = @log_id)
	end
	Commit  transaction
end


i have two table.1)profile :
name
address
city
mob
emailid
log_id

2)login:
log_id
username
password

i have to update data in profile and then select log_id from that updated data.
using this log_id i have to update login table.
for this i have write store procedure as given.but error comming like :storeprocedure expect parameter @log_id

what is problem in my code?
Posted
Updated 26-Jan-13 22:57pm
v2
Comments
Zoltán Zörgő 27-Jan-13 4:52am    
Your procedure code is partial, please improve your question by posting the whole procedure code.

1 solution

"storeprocedure expect parameter @log_id"

Is a pretty clear error message.
When you call the SP, you are not providing all the parameters. Probably, you have miss-spelled "@log_id" as "@logid" or "@log_in" or forgotten it completely. You don't show the code you use to call the procedure, so I can't be any more specific.
 
Share this answer
 
Comments
Member 9511889 27-Jan-13 5:27am    
i have solve this error.now i have not any error,but update will done in profile table only .uasearname and password are not updated in login table.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900