Jun
How to import a UNIX data file
This is a fantastic blog, that everyone doing much database work should look into. While reading about index fragmentation and disc based resource contention, I found this article. Knowing how common Linux web hosting is, and how much better SQL Server is than MySQL, I’m sure I’m not the only one who would love to analyze Apache logs in SQL.
Actually, I’m guessing most of us at least occasionally need to deal with data in files that were created on a different operating system. The step by step of how you go about that is going to be radically different, but the concept is the same.
|
When bulk importing data, the data can come from any source including the files created in other operating systems like UNIX. Here are two ways that you can use to bulk import a data file created under UNIX. ·Without using a format file DECLARE @bulk_cmd varchar(1000) However, the following will not work because ‘\n’ automatically gets converted to ‘\r\n’ since it’s the typical EOF string for Windows text files. The reason that \n works like it does, because we want BCP commands from Unix world on Windows as well bulk insert bcptest |
Relevant Links

