Click here to Skip to main content
15,849,678 members

Comments by KP Lee (Top 14 by date)

KP Lee 6-Feb-14 21:44pm View    
Pretty much the way I would have done it. Maybe less efficient than your code. Maybe dispense with the list altogether and just list one directory and two directories in that one. And put the files in the right directory and list the files to be read. No maintenance of lists and files, just files.
KP Lee 15-Nov-11 1:23am View    
You forgot .WriteXML(filename) to write a dataset into an XML file. You may have done that on purpose because of your additional (valid) point?
KP Lee 15-Nov-11 0:52am View    
First, your "Table_Training_Detalis" alias in your example doesn't exist so it wouldn't work. Second, it is exactly the example of when to NEVER use a cursor.

UPDATE tw set WHIMIS= tc.DateExpires
FROM Table_Courses tc
JOIN Table_Workers tw
ON tw.Worker_ID=tc.Worker_ID AND tw.WHIMIS != tc.DateExpires

Would be about 800 times faster than a cursor. If this is a high volume system where IO contention is a concern, you can use another technique about 400 times faster.
KP Lee 15-Nov-11 0:18am View    
I haven't seen any evidence of a lack of awareness of the cursor command, but I've seen plenty of evidence of when to NOT use a cursor being ignored. There are cases where a cursor is very useful, but that should be the exception instead of the rule. Think SET solution first, second, and third, then cursor.
KP Lee 21-Oct-11 23:29pm View    
I'm willing to learn. I ASKED if it was a bug. If you had said something about "checked" to begin with, I'd have realized that the lazy math was intentional and not a bug at all. This is a complex language, it isn't possible to know everything to begin with. "Help" is certainly NOT a mind-reader and I'm not a mind-reader knowing what keyword to use to find the information I am interested in. Even searching the checked keyword in the index required browsing to find the compiler level version: "/checked[+ | -]" vs. scoped checked/unchecked commands. (Lazy programming is not implementing something for performance reasons, but allowing the program to do what it is supposed to in special cases like applying.)

Yes, I know the hex value of the max int value. It exactly matches the binary value which is 2^31-1. Or 1 zero followed by 31 1's. I don't bother memorizing it, didn't know bit shifting was implemented. I did bother to memorize 2^10 which is 1024 decimal. On a system that checks values, 1024*1024*1024 - 1 + 1024*1024*1024 is the easiest way for me to remember how to mathematically get there. (The Maxvalue property is handy for that.)