Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Article Discussions
»
Article Discussions by Author
»
Discuss content posted by Deepthi Viswanathan...
»
Dynamic creation of Insert, Update, Delete...
47 posts, Page 4 of 5
««
«
1
2
3
4
5
»»
Dynamic creation of Insert, Update, Delete Stored procedure
Rate Topic
Display Mode
Topic Options
Author
Message
midgard
midgard
Posted Thursday, July 08, 2010 10:32 PM
Forum Newbie
Group: General Forum Members
Last Login: Wednesday, May 29, 2013 9:42 AM
Points: 8,
Visits: 40
I use the T4 template processor provided freely in VisualSudio for this. It is much more flexible and easier to read. Also, I can point it to a whole database of tables or a set of tables and generate a whole wad of stored procs. Here is an article about it:
http://www.olegsych.com/2008/01/how-to-use-t4-to-generate-crud-stored-procedures
Post #949718
Boban Stojanovski-455883
Boban Stojanovski-455883
Posted Friday, July 09, 2010 1:17 AM
Valued Member
Group: General Forum Members
Last Login: Thursday, April 18, 2013 5:09 AM
Points: 59,
Visits: 93
I use CodeSmith templates for this task, and much more. You can find my article about
here
. In the
zip
file beside template for procedures, there is also template for data layer class for table and bussiness object class.
Post #949760
sukhendass
sukhendass
Posted Friday, July 09, 2010 2:14 AM
SSC Veteran
Group: General Forum Members
Last Login: Friday, February 22, 2013 3:17 AM
Points: 242,
Visits: 87
Thank u.it's very very useful & time saving for the developers.
Post #949775
firmwu
firmwu
Posted Friday, July 09, 2010 4:04 AM
Grasshopper
Group: General Forum Members
Last Login: Monday, August 29, 2011 10:21 AM
Points: 16,
Visits: 30
Deepthi Viswanathan Nair (7/22/2009)
Comments posted to this topic are about the item
<A HREF="/articles/Stored+Procedures/67055/">Dynamic creation of Insert, Update, Delete Stored procedure</A>
I found an error when column type is NVARCHAR.
ex. nvarchar(255)
----> used your store procedure the datatype become nvarchar(510)
Post #949828
jcraddock
jcraddock
Posted Friday, July 09, 2010 7:27 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Friday, April 05, 2013 1:30 PM
Points: 104,
Visits: 97
Very ingenious, but honestly, the proliferation of procs isn't a good thing.
This is better handled as others have said in client code where one class can dynamically generate all the needed code at run time.
This avoids all types of issues and allows you to keep all the code in the same place - business logic, data validation, etc.
Still, it is very ingenious, I just think less effort would be involved in the long run by keeping such code out of the database.
Post #949949
mike.mahon
mike.mahon
Posted Friday, July 09, 2010 8:24 AM
Forum Newbie
Group: General Forum Members
Last Login: Saturday, July 10, 2010 5:50 PM
Points: 2,
Visits: 5
Yall should check out MyGeneration. They have a huge repository of scripts to generate anything for any language.
http://www.mygenerationsoftware.com/templatelibrary/default.aspx
Post #949981
dg-453058
dg-453058
Posted Friday, July 09, 2010 8:31 AM
Forum Newbie
Group: General Forum Members
Last Login: Monday, July 16, 2012 3:20 PM
Points: 1,
Visits: 9
I appreciate the thought and effort, but this is technology from 8+ yrs ago.. use an ORM and focus on value-added customer functionality
Post #949985
steve.simpson
steve.simpson
Posted Friday, July 09, 2010 10:54 AM
Grasshopper
Group: General Forum Members
Last Login: Friday, April 13, 2012 7:57 AM
Points: 17,
Visits: 35
I understand why people write these utilities, but Microsoft changes system tables and relations between objects with every release. Utilities like this can become quickly out of date, and if deployed into some sort of production automation could cause problems on an upgrade.
Post #950107
James Tran
James Tran
Posted Friday, July 09, 2010 11:10 AM
Forum Newbie
Group: General Forum Members
Last Login: Friday, June 07, 2013 1:39 PM
Points: 2,
Visits: 69
Should look into using n-hibernate tool such as CSLA, LLBLGen Pro, etc... The CRUD procedures should reside in the DataAccessLayer.dll.
Post #950117
Andy Reilly
Andy Reilly
Posted Saturday, July 10, 2010 2:07 PM
SSC Eights!
Group: General Forum Members
Last Login: Thursday, May 09, 2013 6:37 AM
Points: 993,
Visits: 281
The other thing that is missing is any code to handle decimal and numeric datatypes with Precision and Scale.
Post #950375
« Prev Topic
|
Next Topic »
47 posts, Page 4 of 5
««
«
1
2
3
4
5
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.