cannot bulk load

  • Am using bulk insert to load csv file to table. But am failing getting the error

    the file does not exist. Anyone can help urgently

  • Show us the command you're using so we have something to work with.

  • Thanks for replying

    bulk insert sample1

    from 'D:\BEM_Source\Sample'

    with

    (

    rowterminator = '',

    fieldterminator= ','

    )

  • Does a file named "Sample" (with no extensions) exist in the folder "D:\BEM_Source\"?

    Does the SQL Server service account have permission to that folder?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • mandir.jain (2/17/2014)


    Thanks for replying

    bulk insert sample1

    from 'D:\BEM_Source\Sample'

    with

    (

    rowterminator = '',

    fieldterminator= ','

    )

    So, the obvious thing is - does 'D:\BEM_Source\Sample' exist in that folder and on the server that the command is being run from? If I run a Bulk Insert from my PC but connected to server 'Fred1', the file has to be on 'Fred1'.

    If it is in the correct location, can you open the file with a text editor? Just to make sure it isn't corrupt or has attributes/permissions set that make it impossible to open for some strange reason.

  • the file is there. I tried with extensions also like sample.csv and all but no luck. I don know whether sa login used is having the permission to read or not, if it doesnot hav ,please explain how to give

  • the file is there. I tried with extensions also like sample.csv and all but no luck. I don know whether sa login used is having the permission to read or not, if it doesnot hav ,please explain how to give

  • Not asking about the login you are using to SQL Server. Asking about the account that SQL Server runs under.

    The file name you're specifying has no extension. Go to that folder on the server and make sure that the file there also has no extension (remember windows hides extensions by default). Don't guess, access that folder on the server and check exactly what the name is.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • The sql service is running under Network Service. I tried with extensions also:-)

  • That could be part of the problem.

    First, have you logged on to the server and checked exactly what that file's name and extension is?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Both file and sql server are in local only. I went to the the folder and checked ,both are same.

  • sorry I dint get ur saying 'have you logged on to the server and checked exactly what that file's name and extension is'.

  • any help please

  • You say your statement is this:

    bulk insert sample1

    from 'D:\BEM_Source\Sample'

    with

    (

    rowterminator = '',

    fieldterminator= ','

    )

    Questions:

    1. Have you logged in to the server to see if the file is really there?

    2. If the file is there, is the path and filename an exact match to what you've posted above including extension?

    3. Are you able to open the file and see that there's data in it?

  • It appears you are guessing the extension of the file.

    If you open up the D:\ drive in windows explorer, go to the directory you have listed, then right click on the file and choose Properties.

    Type of File should show the extension.

Viewing 15 posts - 1 through 15 (of 21 total)

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