I'm actually very torn on this article...
On the one hand, I agree. As noted by some of the others, the article would certainly have benefitted from the inclusion of some extra information, such as which machine drive-letter reference files must live on or the fact that you can use UNCs instead, etc
On the other hand, this IS a "Spackle" article and, as it says at the beginning of the article, "These short articles are NOT meant to be complete solutions". Is it a 5 Star article in the classic sense? No. But, if you don’t know about BULK INSERT, it IS, most definitely, a MUST READ article because, although it doesn't fill an entire crack in knowledge of T-SQL, it DOES demonstrate the very important and academic concept that the Extract, Translate, and Load process of data doesn't need to be complicated. While that might not provide a benefit to those of us that already know about the likes of BULK INSERT, it does provide the start of an answer to the recent outbreak of posts on this and other sites that can be generically summarized as “How can I import a file into a table”?
What's, unfortunately, not stated in the article and requires someone to actually have enough intellectual curiosity to try the code out and do a little research on their own, is the fact that the code provided imports more than 122 THOUSAND rows and then extracts the required (501) rows in just over a second. And, the author provided the substantial amount of test data to prove it! The article clearly demonstrates that it doesn’t require learning a new language (such as PowerShell), doesn’t require the use of another system/program (such as SSIS or any of a thousand other programs), and doesn’t require much additional knowledge of T-SQL.
In other words, this is a very high altitude and incredibly simple "introduction" to BULK INSERT that says “Look! Importing files can be easy!” and, for those with enough intellectual curiosity to lookup BULK INSERT in Books Online or other web articles, provides a clue to an extremely effective ETL method that they might not have otherwise considered or might not have even been aware of.
With all of that in mind, I say “Well done, Mr. Kulp”. Add a little more detail and advantageous reasons to use a particular feature to future “Spackle” articles and keep ‘em coming!
is pronounced ree-bar and is a Modenism for R
First step towards the paradigm shift of writing Set Based code: Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Helpful Links:
How to post code problemsHow to post performance problemsForum FAQs