I’ve been working on a “blog” application for a client, and one of the tasks has been to write the stored procedures that support all application’s CRUD operations. We’re using SQL Server for the database, and all the tables have already been created. I wanted an easy way to generate all the SQL necessary without hacking it all out myself. My laziness caused me to discovered a handy feature in the management studio that saved me a ton of effort.
While browsing your database objects in the Object Explorer, you can right-click the object and then click Script <object type> as … You’re presented with several options that can be sent to a new query window, clipboard, or a file. You can find more information on this topic at MSDN.
Thanks for posting the article, was certainly a great read!