February 23, 2009 at 2:19 am
Can anybody help in writing a stored procedure to Update a table with ID as primary key
Thanks in advance
February 23, 2009 at 8:07 am
Hi, your question is not entirely clear. Are you simply trying to update a table? Are you trying to change the primary key of the table?
Please elaborate.
Regards, Jim C
February 23, 2009 at 8:25 am
raveen4u (2/23/2009)
Can anybody help in writing a stored procedure to Update a table with ID as primary keyThanks in advance
Yes, but you will need to provide much more information - at the very least, the DDL of the table and where the new values will come from.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
February 24, 2009 at 2:14 am
Hey
I could do that Thanks a lot for inquiring about my query. I'm sorry I didn't elaborate the issue.
Anyways thanks
February 25, 2009 at 1:06 pm
[font="Courier New"]CREATE PROCEDURE [proc_update_table] @key_value [int], @column_value [varchar](50)
AS
UPDATE table_name
SET column_in_question = @column_value
WHERE ID = @key_value[/font]
job done...
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply