generate stored procedures

  • Is there a way in SQL server that can generate stored procedures for select, insert, update, delete on certain tables?

    If not, what other tools do you recommend?

    Thanks,

  • Can you expand further what you need to do?

  • We used to have a codeSmith tool that generate procedures for tables for some existing databases, but it is very old version.

    I am wondering in SQL server if we can do it now, or any other tool?

    Basically I need to generate stored procedures for all tables. the procedures will have select, insert, delete, and update procedures.

  • There's nothing native inside of SQL Server Management Studio that will generate CRUD procedures for you. You'll have to use a third party tool. Codesmith is still out there. Get a newer version of it and off you go. If you do a search online there are a number of other choices. I've only used Codesmith myself.

    By the way, I only trusted Codesmith on the CUD procedures. It didn't always do a great job on the Read queries. I frequently had to adjust those by hand.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • This is kind of straight forward task using SQL Server Management Objects (SMO) in C#/VB.net, i.e. in an SSIS script task etc.. Don't have an example at hand but a Google exercise should return some examples.

    😎

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply