Follow me on Twitter at Twitter.com/wbm
FYI, I'm blogging most of my stuff over at More Wally now.
You might want to add my rss feed to your reader at:http://morewally.com/cs/blogs/wallym/rss.aspx
Why you should do database stuff in the database. - Wallace B. McClure

Wallace B. McClure

All About Wally McClure - The musings of Wallym on Web, HTML5, Mobile, Xamarin.iOS, Xamarin.Android, and Windows Azure.

News

Visual Studio Magazine Column Personal Blog

.NET

Book Authors

Business

Family

Friends

Georgia Tech Bloggers

Personal

Archives

Why you should do database stuff in the database.

Today, I had a need to programmatically update data in one database from another database.  I wrote a quick .NET app to pull the data out of one table, process the data, and put it into another table in another database table.  I just went to write a quick utility because I was running in two databases.  I didn't check the amount of data, but I saw that this was really slow.  As the data ran through the triggers, it was way to slow.  it was taking about 2 seconds for each record.  It would have resulted in approximately 2 days of processing.  Well, that was not acceptable.  I pulled up my SQL Server Books Online and grabbed a couple of TSql commands.  The resulting TSql command took 16 seconds to run.  Moral of the story, if you can do it in the database, you should probably do it in the database.

Wally

Comments

Ron K said:

Please post the TSQL commands you used. Thanks.
# June 30, 2005 4:03 PM

Raymond Lewallen said:

So what made you want to do it in .Net anyways? Plain ol' curiosity? Because its more fun? :)
# June 30, 2005 4:33 PM

Jerry Pisk said:

Triggers are evil.
# June 30, 2005 9:54 PM