how to load Data From a big file ...

  • Hi Everybody,

    I have big XML file (30 mbs)....i have to pass the data to a stored procedure...For this i have to read the physical file into memory, whats the best way of doing it in VB

    i have to insert data in a table in sql server from a XML File (30 Mb say)...i am using a stored procedure that accepts a text parameter.

    There are two options with me...

    1. if i can open a disk file with in stored procedure i need not pass XML data as argument to Stored procedure...thus solving the very problem....but i dont know a whay to access physical files from with in a ms sql server stored procedure...

    If u can suggest me way to do this ....no thing like that...

    other wise option

    2. Pass the data from xml file in one go or in portions to the stored procedure. Which is better approach ...in sets of records ...mutiple times calling the stored procedure or entire xml data in one shot thus only a single to call to stored procedure...

    Help me friends...

    naveen

  • Sounds like you should try using bulk insert or bcp. Search in Books on Line for details but a simple statement would look something like this;

    BULK INSERT Northwind.dbo.[Order Details]

    FROM 'f:\orders\lineitem.tbl'

    WITH

    (

    FIELDTERMINATOR = '|',

    ROWTERMINATOR = '|\n'

    )

    The only consideration here is that the table you specify must match your file layout so, you may have to create an interim table for the load.

    Hope this helps.

    David

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply