Need Help for OPENROWSET

  • Today i had a task to import the csv file into the database.

    For that i choosed the OPENROWSET method.

    when i use this OPENROWSET in sql server 2000, i am getting the following result.

    it is not giving the correct result, its reapeting the column names

    query used:

    select * from OPENROWSET('Microsoft.Jet.OLEDB.4.0','Text;Database=F:\','select top 10 * from npidata.csv')

    when i used this query in sql server 2005.

    it is giving me the following error

    Duplicate column names are not allowed in result sets obtained through OPENQUERY and OPENROWSET. The column name "npidata#csv.P" is a duplicate.

    but when i open and save csv file in the excel then the result is ok.

    it is giving exact rows

    i dont know why this is happening for me

    any suggestion would be appreciated

    i am attaching the file along with this mail in txt format due to file format restriction

    Thanks in Adv

    Parmesh

Viewing post 1 (of 1 total)

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