April 3, 2015 at 4:25 pm
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,
April 3, 2015 at 4:29 pm
Can you expand further what you need to do?
April 3, 2015 at 4:34 pm
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.
April 4, 2015 at 3:20 am
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
April 4, 2015 at 3:38 am
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