How to Create Stored Procedures Automatically
The most efficient way to access data from a database is to use stored procedures. Fortunately most applications have stored procedures that follow the same basic operations and design. For large tables or a large number of tables, writing these stored procedures can be very cumbersome and prone to typographical errors. These types of stored procedures are prime candidates for automatic stored procedure generation.
This article has been tagged as a stub. That means it's off to a good start, but still has room to grow into a more helpful resource. Until the article reaches its full potential, it will be hidden from search results. Can you help it flourish? If you think the article offers complete and accurate instructions, feel free to remove this tag. |
Steps
-
1Read Database schema using Information_schema views.
-
2Identify Primary key & Foreign key columns using referential relation.
-
3Categorize columns using their data type like datetime, varchar, int, boolean, image, null etc...
-
4Set stored procedure name - Table name followed by Operation name or vice a versa.
-
5Ask for parameter naming convention.
-
6Combine this and generate stored procedure.
About this wikiHow