2

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?

Jonas
  • 121,568
  • 97
  • 310
  • 388
Dennis C
  • 24,511
  • 12
  • 71
  • 99

3 Answers3

1

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.

Dave Markle
  • 95,573
  • 20
  • 147
  • 170
1

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.

Abram Simon
  • 3,239
  • 21
  • 17
1

You can always use bcp utility

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

Learning
  • 8,029
  • 3
  • 35
  • 46