COUNT THEN UPDATE ELSE INSERT CREATE PROCEDURE / CURSOR
How to Button1_Click Count and if (count) ==0 EXISTS update query than (count) ==1 update else insert asp .net
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Oct 15, 2013, 7:20 AM
I think this can be achieve with in store procedure....
like
create procedure tes
(
@id int
)
AS
begin
if(EXISTS(select * from table1 where ID = @id)
begin
-- write you update table statement here
end
else
begin
-- write you insert table statement here
end
end
hope this will help you.
Jaganathan BantheswaranPosted Oct 15, 2013, 3:25 AM
Please give us some more details.