boobalanmca07 (11/27/2012)I am using two sql statements in stored procedure,the two sql query is update and alter.in some times i need to execute update query only,at that time how to execute stored procedure

ALTER? to alter a table, it would only need to occur once, ever, in the database; doesn't really belong in the procedure.otherwise you end up having to test every time whether to do it or not, which, since it will occur once, wastes a little bit of time checking to see if it needs to be done.

so my advice is to rethink where to put the alter statement...i don't think it belongs in a procedure.

Could you please post your stored procedure code?Without seeing what you can see it's hard to provide relevant help. Please read an article from the link at the bottom of my signature about this forum etiquette.

From your very vague description, I can only guess that you have to choices:

1. Create a separate stored proc which only performs UPDATE2. Amend the existing one to have input parameter as a flag which will determine its behaviour.