Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hi buddy
Can we pass two sql queries for button(select and insert) at a time.

Thanks
Posted

1 solution

Hi
if i understand it correctly, you can write a single Stored procedure for insert and update
SQL
IF EXISTS(SELECT ID from Table where ID=@PK)
BEGIN
	--Update Query
	UPDATE Table Set ....
	WHERE ID=@PK
END
ELSE
	---Insert Query
 
Share this answer
 

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