Geeks With Blogs

(Amazon Affiliate Ads)

Mike Parks Code.Where(c => c.IsTechnicalDebt).Refactor(); June 2011 Entries
A little SQL tip for C# developers
The other day at work I came across a handy little block of SQL code from Jeremiah Clark's blog. It's pretty simple logic but through the mind of a C# developer making some quick DB updates, seems to me that it's more likely to end up writing out the code in Solution 1 instead of Solution 2 below to solve the problem. Basically, I needed to check and see if a specific record existed in Table1. If it does exist, then update that record, otherwise insert a new record into Table1. Solution 1: IF EXISTS ......

Posted On Saturday, June 18, 2011 1:46 AM

Copyright © MikeParks | Powered by: