SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


is there a way to auto-gen crud sprocs in ssms 2017?


is there a way to auto-gen crud sprocs in ssms 2017?

Author
Message
sqlguy-736318
sqlguy-736318
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3111 Visits: 454
Is there a way to auto-gen CRUDsprocs in SSMS 2017? For example, a basic User table might just need cookie cutter CRUD sprocs. I know there were some after-market tools that auto-genned sprocs for a given SS table 10 years ago. I was wondering if this functionality is built into SSMS now. If not, then what are some of your favorite tools to accomplish this?
sgmunson
sgmunson
SSC Guru
SSC Guru (79K reputation)SSC Guru (79K reputation)SSC Guru (79K reputation)SSC Guru (79K reputation)SSC Guru (79K reputation)SSC Guru (79K reputation)SSC Guru (79K reputation)SSC Guru (79K reputation)

Group: General Forum Members
Points: 79601 Visits: 6523
I don't know about you, but don't you think developers should be able to write a CRUD sproc in a matter of a few minutes? Generating a CRUD sproc seems like it's likely to waste more of your time trying to conform the code to company standards than just writing it to spec in the first place. I'd actually worry about a developer's skillset if they came to me to ask that question.

Steve
‌(aka sgmunson)
Smile Smile Smile
Health & Nutrition
Steve Jones
Steve Jones
SSC Guru
SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)

Group: Administrators
Points: 562315 Visits: 20826
I've just written scripts to do this. We have some here at the site: http://www.sqlservercentral.com/scripts/T-SQL/67368/

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Bill Talada
Bill Talada
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10120 Visits: 2296
I've got a dozen scripts and functions to generate CRUDs and Change Scripts that I've been perfecting for 10 years and just rewrote them to be even cleaner and more powerful. They use their own simple template language. I use them on several projects to generate dozens of procs per table for the 500+ tables in each project. About 20% of generated ones get converted into custom procs by developers and the generator is wise enough to not overwrite customized ones. I've been wanting to write a tutorial article demonstrating these generators but it may take me a couple months to get it packaged and elegantly written up.
Jack Corbett
  Jack Corbett
SSC Guru
SSC Guru (158K reputation)SSC Guru (158K reputation)SSC Guru (158K reputation)SSC Guru (158K reputation)SSC Guru (158K reputation)SSC Guru (158K reputation)SSC Guru (158K reputation)SSC Guru (158K reputation)

Group: General Forum Members
Points: 158628 Visits: 15121
If you have your databases in an SSDT database Project you can use T4 templates to generate CRUD procedures. I've also used written T-SQL to generate them, but since I try to always have my databases in database projects and source control, I now prefer T4 templates in SSDT. Here's a link to a presentation I do on it and it has examples.



Jack Corbett
Consultant Straight Path Solutions
Dont let the good be the enemy of the best. -- Paul Fleming
At best you can say that one job may be more secure than another, but total job security is an illusion. -- Rod at work
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a QuestionHow to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search