Mike Parks

"If you want to be the best, you've got to work with the best"
posts - 26, comments - 104, trackbacks - 0

My Links

News

Archives

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 | Feedback (2) |

Powered by: