Stored proc with asp.net

M

Mark

Hi
I have a stored proc that inserts values into a db, now i
want to give that stored proc a row Id for it to update.
cant get it working though
heres the code
<code>
ALTER PROCEDURE dbo.AddPay
(
@Pay VarChar(50)
)
AS
Insert into TestFile
(
Pay
)Values (
@Pay
where Id = @Id)
</code>

any ideas?
thanks
Mark
 
H

Hans Kesting

see inline

Mark said:
Hi
I have a stored proc that inserts values into a db, now i
want to give that stored proc a row Id for it to update.
cant get it working though
heres the code
<code>
ALTER PROCEDURE dbo.AddPay
(
@Pay VarChar(50)
)
AS
Insert into TestFile

to change a row you need an UPDATE command
(
Pay
)Values (
@Pay
where Id = @Id)

this closing ) should be after the last value (before the "where")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top