Import Data from XML,Excel and csv to MS Sql Server 2005 Express.

  • Hello,

    I want to import data from XML,EXCEl and csv to sql server 2005.I am using MS Sql Server 2005 Express edition .How can implement this?

    Please help me....

  • Check the limitations of SQL Express. I'm pretty sure that you can't "import" from files without Integration Services, which is not part of Express edition.

    You should be able to import the csv using BULK INSERT.

  • Perhaps you could open the XML in Excel, then save the Excel workbook as CSV then do a BULK INSERT.

    Kind regards

    Ross

  • Sabid.m

    Use Books On Line (BOL) and read up on the "Openrowset" command. It can be utilized to read from a csv file, an Excel Spread Sheet as well as perform a bulk import. Here is some additional explanations of how to use Openrowset.

    http://www.sql-server-helper.com/tips/read-import-excel-file-p02.aspx

    SELECT * FROM OPENROWSET('Microsoft.jet.OLEDB.4.0','Excel 8.0;DATABASE=c:\temp\items.xls;IMEX=1','SELECT * from [items$1]')

    http://www.sql-server-helper.com/tips/read-import-excel-file-p02.aspx

    SELECT * FROM OPENROWSET('Microsoft.jet.OLEDB.4.0','Excel 8.0;DATABASE=c:\temp\items.xls;IMEX=1;HDR=No','SELECT * from [items$1]')

    Here is a sample importing from a csv file.

    SELECT cast(field1 as bigint) as field1,cast(field2 as varchar(15)) as field2

    INTO dbo.file1table2

    FROM

    OPENROWSET('MSDASQL','Driver={Microsoft Text Driver (*.txt; *.csv)};

    DefaultDir=X:\;',

    'SELECT * from X:\Test\Import_OpenRowset.csv')

    Select * from dbo.file1table2;

    Also go to the Simple Talk site which has a series of very helpful articles on just what you want to accomplish.

    http://www.simple-talk.com/community/login.aspx?ReturnUrl=/

    Hope this helps

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

Viewing 4 posts - 1 through 3 (of 3 total)

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