Click here to Skip to main content
15,881,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi,

I'm having some datatables in sql server database. I want to update multiple values in a table using values from ather tables and some conditions. I wrote the update query but it is too long. front end I'm using is asp.net. Can I use this query in stored procedure? I dont know how to use stored procedures. Anyone please help me...

Thank you
Posted

1 solution

Yes you can use that query in a stored procedure. Put your whole update query in a stored procedure with input parameters defining which fields of what tables will be getting updated. Following articles will help you do so:

Sql Server - How to write a Stored procedure in Sql server[^]
http://msdn.microsoft.com/en-us/library/ms345415.aspx[^]
creating-and-managing-stored-procedure-in-sql-server-2008[^]
http://www.c-sharpcorner.com/UploadFile/rohatash/select-insert-update-delete-using-stored-procedure-in-sql/[^]
 
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