Question

For some reasons, SSIS is not avalialble.

I read about OPENROWSET, but I will have others problem from on the format file and path of file.

How can I do it in a elegant way?

Was it helpful?

Solution

You can always use bcp utility

It's been around since the earliest versions and is very easy to use.

OTHER TIPS

If the files are delimited like a csv you could use the Fast CSV Reader found on CodeProject. If it's not a standardized format then I agree with Dennis, a custom console app may be the way to go.

Not knowing your whole situation, here's what I would recommend on the face of it.

If you don't have SSIS, and you don't want to deal with the BULK INSERT/bcp format file, I would venture to say that the most elegant way to import the file would be to write your own small .NET-based console application to do it.

Note that if you can load data into a DataTable, you can use the SqlBulkCopy class in .NET.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top