Problem in bulk import of text files in SQL Server

Hi,
I am using sql server 2012 x 64 and trying to import some text files (tab/ comma separated) and ms access files in sql server tempdb
I am trying bulkinsert on text file but it is inserting all data in a single line in sql while in text file I have 1000K lines,
Then I tried importing other data using openrowset from access file but I am getting following error
Cannot create an instance of OLE DB provider "MSDASC" for linked server "(null)".
can any one please provide some assistance . If I am able to upload the data from flat text file then it will be enough as I am getting data in tsv or csv format
Nitin

If this is a one-off, I think you should try the import/export wizard in SQL Server Management Studio instead. This may be easier to get working.
If you want to this import on a regular basis with BULK INSERT, we need to see the CREATE TABLE statement for your table and a sample file. Best if you can upload the file on Skydrive, Dropbox or similar, as the exact bytes matters.
To connect to an Access database, you use the ACE provider. Never heard of MSDASC before.
Erland Sommarskog, SQL Server MVP, [email protected]

Similar Messages

  • Error importing text file into SQL Server when last column is null

    Hello all. Happy holidays!
    I'm trying to import a text file into a SQL Server table, and I get the error below when it gets to a row (row 264) that has null in the last column. I'm guessing the null jumbles up the delimiters somehow. The nulls are not errors, and I need to import
    them into the table with the rest of the rows. Any idea how I can do that?
    Thanks!
    [Flat File Source [1]] Error: Data conversion failed. The data conversion for column "XYZ" returned status value 2 and status text "The value could not be converted because of a potential loss of data.".
    [Flat File Source [1]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "output column "XYZ" (178)" failed because error code 0xC0209084 occurred, and the error row disposition on "output column "XYZ"
    (178)" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure.
    [Flat File Source [1]] Error: An error occurred while processing file "ABC.txt" on data row 264.
    [SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on component "Flat File Source" (1) returned error code 0xC0202092.  The component returned a failure code when the pipeline engine called PrimeOutput().
    The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure.
    WeeLass

    Hi WeeLass,
    The error that” Data conversion failed. The data conversion for column "XYZ" returned status value 2 and status text "The value could not be converted because of a potential loss of data.".” is generally error message, and the error indicates
    that there is data type mismatch issue between the input columns and the output columns.
    Based on your description, the issue is that you trying to convert a column contains empty value from string to integer data type for the output column "XYZ" in Flat File Source [1]. Please note that we cannot type an empty value as integer data
    type column value, so the error occurs.
    To fix this issue, just as you did, we should convert the data type for the output column "XYZ" in Flat File Source [1] back to DT_WSTR or DT_STR, then use a derived column task to replace the current column (UBPKE542). But the expression should
    be like below:
    LEN(TRIM(UBPKE542)) > 0 ? (DT_I8)UBPKE542 : NULL(DT_I8)
    In this way, the data type of the column in SQL table would be int, and the empty value would be replaced with NULL.
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Problem with saving data in text file in Application server

    Hello Experts,
    I am trying to save a text file in application server.When I text file have less that 60000 (i.e 59999) records, it saves the file successfully, but if records in text file (saved in application server) is more than 60000 (i.e 60002), it creates a new file at the 60000th record with the continued records.
    Can anyone please advise, why it is creating a new file if records are more that 60000. I tested it with 59000 records in my internal table and it is working fine. I have not given any restriction in my program to create a new file if records are more than 60000.
    The logic I implemented is the following:
    *Open file
      open dataset g_accnt_file for output in text mode encoding utf-8.
      if sy-subrc = 0.
        clear g_header_record.
    *Building header record for Accounting Validation file
        concatenate gc_hdr_desc
                    gc_filetype
                    gc_sequence
                    gc_idntf_refresh
                    gc_cmpny_idntf
                    gc_accnt_id
                    sy-datum
                    sy-uzeit
                    gc_linde_group
                    sy-sysid
                    gc_not_used into g_header_record separated by
                                               gc_deliminator.
        transfer g_header_record to g_accnt_file.
    *Move Cost center data to file to create a detail record for Accounting
    *Validation file
        loop at gt_csks into gs_csks.
    *Remove leading Zeros
          call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
            exporting
              input  = gs_csks-kostl
            importing
              output = gs_csks-kostl.
    *      Overlay gs_csks-kostl with space.
    *      SHIFT gs_csks-kostl RIGHT DELETING TRAILING gc_space.
    *Prepare Cost Centre String
          perform prepare_costcentre_string.
    *Prepare detail record with Company Code & Cost Centre
          perform prepare_detail_record.
          clear:g_detail_record,gs_csks,g_coa.
        endloop.
    *Move Order data to file to create a detail record for Accounting
    *Validation file
        loop at gt_aufk into gs_aufk.
    *Remove leading Zeros
          call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
            exporting
              input  = gs_aufk-aufnr
            importing
              output = gs_aufk-aufnr.
    *      SHIFT gs_aufk-aufnr RIGHT DELETING TRAILING gc_space.
    *Prepare Order String
          perform prepare_order_string.
    *Prepare detail record with Company Code & Order
          perform prepare_detail_record.
          clear:g_detail_record,gs_aufk,g_coa.
        endloop.
    *Move WBS data to file to create a detail record for Accounting
    *Validation file
        loop at gt_prps into gs_prps.
          call function 'CONVERSION_EXIT_ABPSP_OUTPUT'
            exporting
              input  = gs_prps-pspnr
            importing
              output = g_wbs_element.
    *      SHIFT g_wbs_element RIGHT DELETING TRAILING gc_space.
    *Prepare WBS Element String
          perform prepare_wbs_string.
    *Prepare detail record with Company Code & WBS Element
          perform prepare_detail_record.
          clear:g_detail_record,gs_prps,g_coa.
        endloop.
    *Building trailer record for Accounting Validation file which will
    *contain the total number of detail records in file
        concatenate gc_trail_desc
                    g_total_count
                    into g_trailer_record
                    separated by gc_deliminator.
        transfer g_trailer_record to g_accnt_file.
    *Close file
        close dataset g_accnt_file.
        if sy-subrc = 0.
          message s036(/lig/fi).
        endif.
      endif.
    endform.                    " SELECT_DATA
    Edited by: Matt on Sep 30, 2010 11:02 AM - added   tags

    Hi Pankaj,
    Can u check the concatenate statement with one more data. Check the no of lines for a single file.
        concatenate gc_hdr_desc
                    gc_filetype
                    gc_sequence
                    gc_idntf_refresh
                    gc_cmpny_idntf
                    gc_accnt_id
                    sy-datum
                    sy-uzeit
                    gc_linde_group
                    sy-sysid
                    sy-subrc
                    gc_not_used into g_header_record separated by
                                               gc_deliminator.
    Regards,
    Amitava

  • Import a CSV text file into SQL Server using DTS

    Hi,
    This may be a silly question but im gonna ask it anyway!
    What i need to do is execute a DTS package from a CF page to read a text file and import its content to a table. I have 100's of txt files with 10,000's of rows.
    The reason i think this is a silly question is because when setting the DTS package in SQL Ent, you have to specify the file name of the file you wish to import data from, therefore, its possible that you cannot change the file name. Ive done lots of research and not found one example that will allow me to do dynamically change the file name making the DTS pick up a different file. The only code ive found is as below, that executes the DTS and imports the data obtained from the file name that was set when the DTS package was created.
    <cfobject
    type="COM" name="objDTS" class="DTS.Package" action="CREATE">
    <CFSET
    r = objDTS.LoadfromSQLServer("[SERVERNAME]","[PASSWORD]","",0,"","","","[DTSPACKAGE]","")>
    <cfset
    p = objDTS.Execute()>
    I found the following suggestion in a forum somewhere, but ive not had much luck with it
    <cfset
    objDTS.GlobalVariables.Item("filename").Value = "[statsFileName]">
    I know an alternative to this is to read the file using CFfile or using Java and insert one by one, i dont dont like that method as it could cause performance issues with my server.
    Hope someone can help me out.
    regards
    d

    Questions:
    1. What version of SQL Server are you using?
    2. Are you required to use a specific DTS package or do you simply need to import data from a file to a table?  You might also consider using the bcp utility or, if you are using 2005 or newer, integration services.
    3. Is the uploading of files and the import of data a manual process or is it automated?  Is there a user uploading one file at a time to your server or do you receive files in batches.  Can you describe the work flow?
    You might try the following if you are required to use DTS:
    1. Upload your text file with CFFILE, putting in the directory expected by your DTS package.
    2. Rename the file to the name required by your DTS package
    3. Use CFEXECUTE to run the DTS package by calling dtsrun at the command line.
    dtsrun
    http://msdn.microsoft.com/en-us/library/aa224467%28SQL.80%29.aspx
    bcp
    http://msdn.microsoft.com/en-us/library/aa174646%28SQL.80%29.aspx

  • Best way to import csv file into sql server

    Hello DBAs
    always thankful for your help and one question, what is the best way to import a csv file into sql server ?

    and there is a
    Bulk Insert Task for the Control Flow.
    http://www.youtube.com/watch?v=ACuCU6IqO50
    Please mark the post as answered if it answers your question | My SSIS Blog:
    http://microsoft-ssis.blogspot.com |
    Twitter

  • Importing excel file to SQL Server

    I have an application that needs to import an excel file with
    10 columns of data into an SQL Server database table with 13
    columns of data. Two of the 3 extra database columns are manditory,
    and I need to manipulate the values going in.
    I've determined the best method to do this using coldfusion
    is to import the excel file into a cvs file then use SQL to import
    the cvs file into SQL server. Does anyone know how to import an
    excel document into a cvs file using ColdFusion?
    Thanks!

    A couple of things come to mind. You might consider using DTS
    to import your data directly into SQL Server from Excel, rather
    than putting ColdFusion in the middle. Or, you might consider
    creating a ColdFusion ODBC datasource out of your Excel file, use a
    cfquery to select the applicable data, then insert the data into
    SQL Server in a loop. Not very efficient, but it can be done.
    Phil

  • Importing a text file and displaying it

    Ok, my goal is to import a text file which i have done. I want to import it into a 2D array. There are 26 rows and 2 columns. Basically just a translator program. This is what i have to load the text file into java. But i am having trouble displaying the array with the data loaded into it. any ideas?
    public static void loadData(String a[][])
         throws java.io.IOException
         String file = "C:\\print.txt";
         String inLine;
         int row;
         FileReader fr = new FileReader(file);
         BufferedReader br = new BufferedReader(fr);
         for (row = 0; row<=26;row++)
              a[row][0] = br.readLine();
              a[row][1] = br.readLine();     
         br.close();     
         System.out.println(a[row][0]);
         }     

    my goal for this program is to have a user enter a phrase to be translated. I have the text file that i am loading into java that has the english word and then the translated word. I want to load that into the 2D array and display it. Then use a stringtokenizer for the translate part. But the problem i have right now is trying to display the data that was loaded into the array. any ideas?

  • What happened to importing plain text files in iTunes?

    I used to be able to export the playlist containing all the music I wanted to listen to as a plain text file. I would then import this file into a spread sheet, sort as I desired, assign each song a number, sort on that number and save the resulting groups to plain text files. I would then import these text files as playlists. It appears that this capability has disappeared in the current version of iTunes. I am capable of working with the xml if I have to, but that is more effort than I think is necessary. Have I missed something?

    I have been thinking about what you are suggesting and even with your last reply it does not solve the problem. I suspect you still do not see what I am driving towards. I have playlists for all songs with 5 starts, all songs with 4 stars, all songs with number of plays less than n. I also have playlists of those three that have not been played in n days. I listen to those sometimes. I also listen to my existing playlists which contain subsets all music not christmas and have at least a 3 start rating. This last set is not smart at present. With the current setup, music in those first 3 playlists get played more often. Any smart playlist that has to include not played in the last x will not play those songs more often unless I play those playlists more often. At present, to generate those non smart playlists I export, divide, and import information. Apple has changed the format it accepts on input. I either have to accept their new import method and start programming, or find a smart playlist method that solves this problem. I do not believe that anything yet suggested for smart solves the problem. The closest I have come is 3 playlists. One smart and two dumb. The smart one is all songs with rating above 3 and not christmas that have not been played in last x and is not in the two dumb ones and limit to 100. The dumb ones start empty. Let it populate, drag the list to one of the dumb ones. Let the smart one recompute. Drag it to the second dumb one. Play one list on each device. When playlist finishes, blank the dumb one for that device, sync, let iTunes repopulate the smart list, drag to dumb list and sync again. In the long term, I think I am better off programming.

  • Error while importing a text file for a list of values

    Hi Experts,
    While importing a text file for a list of values in designer, I am getting error message as below:
    "Invalid setting in Excel key of the Engines section of the Windows Registry. (3433)".
    I am using BO XI R3. Universe Designer version : 12.1.0.882
    Any suggestion ?
    Regards

    plzzzzzzzzzzzzzzzzz.............sme1 help me out

  • "Import from Text File" & "Upload from Clipboard" icon not appearng in F110

    Hi Experts,
    While making the payment to the vendors through TN F110, in "PARAMETER" screen just next to 'STATUS' screen, there is a vendor field for selection in range and just ahead of this there is an icon for multiple vendor selection ( Bold arrow mark ). If I click on that multiple vender selection icon ( on bold arrow mark ), an another screen opens for multiple selection for vendors. In this screen 'Enter, Copy, Delete etc' icons are appearing at the bottom of the screen but "Import from Text File" & "Upload from Clipboard" icon are not appearing there.
    Can you please let me know how to bring that icons there?
    Points would be awarded.
    Rgds,
    Shailesh

    Hi Ravi,
    I have not yet created anything and have just entered the parameter. In the multiple screen for vendors there are 5 fields for individual and 5 for range selection. Even you can put more than five range selections or individual selections by clicking on the page button but there I am not finding these two icons.
    Can you please check at your end and let me know if you are getting or what to do to bring those two icons in F110.
    Rgds,
    Shailesh

  • Bulk insert of text file Help PLEASE!

    Hello,
    I am trying to insert the following data into a sql server table.
    11470012 31020141100AMFI2              TENTATIVE APPOINTMENT SET FOR 03/17/2014 AT 10:00 AM
    11470012 31720141000AMFI7              INTERVIEW COMPLETED.
    I am using the following code.
    Bulk Insert dbo.Totalnt
    From 'c:\totalnt.txt'
    with (rowterminator = '\n');
    I get the following error.
    Msg 4866, Level 16, State 7, Line 4
    The bulk load failed. The column is too long in the data file for row 1, column 1. Verify that the field terminator and row terminator are specified correctly.
    Msg 7399, Level 16, State 1, Line 4
    The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.
    Msg 7330, Level 16, State 2, Line 4
    Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".
    Please help,
    M. Wilson
    M. Wilson

    Here is the create table statement.  I appreciate your assistance.  I have never imported a file into sql server.
    USE
    [2013ProductionData]
    GO
    /****** Object:  Table [dbo].[Totalnt]    Script Date: 03/31/2014 21:24:17 ******/
    SET
    ANSI_NULLS
    ON
    GO
    SET
    QUOTED_IDENTIFIER
    ON
    GO
    CREATE
    TABLE [dbo].[Totalnt](
    [Cluster] [nvarchar]
    (2)
    NOT
    NULL,
    [Project] [nvarchar]
    (3)
    NOT
    NULL,
    [Case] [nvarchar]
    (2)
    NOT
    NULL,
    [RecType] [nvarchar]
    (1)
    NULL,
    [ContactDateM] [nvarchar]
    (2)
    NULL,
    [ContactDateD] [nvarchar]
    (2)
    NULL,
     [ContactDateY] [nvarchar]
    (4)
    NULL,
    [ContactTimeH] [nvarchar]
    (2)
    NULL,
    [ContactTimeM] [nvarchar]
    (2)
    NULL,
    [ContactTimeAMPM] [nvarchar]
    (2)
    NULL,
    [Who] [nvarchar]
    (2)
    NULL,
    [Result] [nvarchar]
    (1)
    NULL,
    [ApptDateM] [nvarchar]
    (2)
    NULL,
    [ApptDateD] [nvarchar]
    (2)
    NULL,
    [ApptDateY] [nvarchar]
    (4)
    NULL,
    [ApptTimeH] [nvarchar]
    (2)
    NULL,
    [ApptTimeM] [nvarchar]
    (2)
    NULL,
    [ApptTimeAMPM] [nvarchar]
    (2)
    NULL,
    [Comments1] [nvarchar]
    (50)
    NULL,
    [Comments2] [nvarchar]
    (50)
    NULL,
    [Comments3] [nvarchar]
    (50)
    NULL,
    [Comments4] [nvarchar]
    (50)
    NULL
    ON [PRIMARY]
    GO
    M. Wilson

  • When I import a text file(comma separated )into a numbers spread sheet all the data goes into one column. Why does the text not go into separate columns based on the commas.

    When I import a text file(comma separated) into a numbers spreadsheet all the data goes into one column instead of individual columns based on the comma separators.  Excel allows you to do this during the import..  Is there a way to accomplish this in numbers without opening it in Excel and the importing into Numbers.

    Your user info says iPad. This is the OS X Numbers forum. Assuming you are using OS X… Be sure the file is named with a .csv suffix.
    (I don't have an iPad, so I don't know the iOS answer.)

  • How to import a text file created in Pages (iWork '08) to Photoshop Elements

    I am totally a novice at working with Photoshop Elements.  I need help.  I want to create my business card in Photoshop Elements with a background image and then a text layer over the background layer.  The logo and text was created in Pages (iWork '08).  Can I import this text file to Photoshop Elements and if so how do I do that?  I cannot create the same logo in Elements unless someone can tell me how to draw a circle with a transparent background so that just the outline of the circle shows and the background comes through.  Thanks for any help you can offer.  I have OS X Snow Leopard 10.6.4 and Photoshop Elements 6.

    In PSE, to draw an empty circle use the elliptical marquee tool and hold down shift while you drag to constrain it to a circle. That will give you an empty selection, then go to Edit>Stroke (outline) selection. A window appears where you can choose the width and color of the stroke.
    However, I'm not understanding why you would want to create your business card in PSE rather than in Pages or equivalent. Is there a special reason for this?
    EDIT As for the text file, it would be simpler just to retype it in PSE, since it can't be very much text. Remember that PSE doesn't do all the fancy things with text that Pages can, although it can do some things (like warping) that Pages can't.
    You could activate the text tool and use copy/paste, but you'll lose most of the formatting.

  • Importing a text file with variable values into web reporting

    Hello,
    I'm looking for a possibility to import values from a text file into a variable selection in Web reporting.
    With BEx reporting in Excel this is possible, by clicking on the multiple selection button in the variable popup screen, and subsequently selecting the "Import from Text file" button.
    However, this function seems not to be available for web-reporting...
    It would be great if someone could help me out with this!
    Thanks & regards,
    Arvid

    Hi,
    we could resolve this issue, so i thought it may also be helpful for others:
    In our example we used a file with numbers for materials. This file is stored somewhere in a directory, to which SAP BI must have authorization to read.
    The file looks something like this:
    4711
    4712
    4713
    4714
    The file is named "import.txt" and lays in directory "/usr/sap/EC6/files/bi/"
    *&  Include           ZXRSRU01
    * global variables
    Data: intern_range LIKE LINE OF i_t_var_range,
          l_s_range    TYPE rsr_s_rangesid,
          line(100)    TYPE c,
          p_file(128)  TYPE c,
          length_rangelow  type i,
          tmp_rangelow     like l_s_range-low.
    * internal tables for selection-transfer from transaction
    * Data: BEGIN OF it_file occurs 0,
    *        it_p_file(128) TYPE c,
    *      END of it_file.
    IF i_step = 1.
    ** variables can be changed or set before pop-up appears
      CASE i_vnam.
    * take material from external file to selection-list
         WHEN 'ZSD_UPMA'.
    ** call of transaction, with which the path can be set
    *CALL TRANSACTION 'ZBW_VARIABLE' using it_file
    *MODE 'A'      " call should be visible, so that variable can be set
    *UPDATE 'S'.   " first transaction, then processing
    ** Der Pfad, der in dem Selektionsbild eingegeben wird, wird an die Variable übergeben
    ** Der Set-Parameter ist in Report ZSD_SELECT_VARIABLE
    *  get parameter id 'VAR' field p_file.
    p_file = '/usr/sap/EC6/files/bi/import.txt'.
    * further handling of variable in BI
          OPEN DATASET p_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
          IF sy-subrc = 0.
            READ DATASET p_file INTO line.
            WHILE sy-subrc = 0.
              IF line(2) <> '//'.
                l_s_range-sign = 'I'.
                l_s_range-opt  = 'EQ'.
                l_s_range-low  = line.
    * fill with leading Zeros
    * in variable tmp_rangelow the value from l_s_range-low is taken
        tmp_rangelow    = l_s_range-low.
    * read the length
        length_rangelow = strlen( tmp_rangelow ).
    * in our case: material has 18 characters
        while length_rangelow lt 18.
          CONCATENATE '0' tmp_rangelow INTO tmp_rangelow.
          length_rangelow = length_rangelow + 1.
        endwhile.
    * initialize l_s_range-low
        clear l_s_range-low.
    * set with filled values
        l_s_range-low = tmp_rangelow.
    * transfer to structure
                APPEND l_s_range TO e_t_range.
              ENDIF.
              READ DATASET p_file INTO line.
            ENDWHILE.
          ENDIF.
          CLOSE DATASET p_file.
        ENDCASE.
    ELSEIF i_step = 2.
    ** in step 2 all variable values from pop-up input can be processed or
    ** User Exit variables can be derived
    * UserExit Ende.
    ENDIF.
    Hope i could help!
    Best regards,
    Tobias

  • How can we import a text file in Labview,Is this process require CIN utility

    Hi,
    I am working in physics lab where i am working on labview and want to import a text file in labview, if anyone knows ,please mail me at [email protected]

    Hi Ajay,
    See attached V 7.0 example...
    Hope it helps,
    Nick
    Attachments:
    Read_txt_File.vi ‏20 KB

Maybe you are looking for

  • Low FSB problem on MSI K7N2 Delta-ILSR.

    Today is the first day this happened, and I don't know why it did it. I've had this for 5 days with no such problem like this B4.   Here goes... in my BIOS, I have the FSB set to 166(333), and the Ram synced with it. This afternoon I started up my co

  • ASA 5505 rookie - can't ping remote site or vice versa

    Hi, I'm trying to setup an ipsec from an ASA 5505 (8.4) to a Sophos UTM (9.2) Internet etc is up and accessible. Ipsec tunnel is up also but I can't pass traffic through it. I get this message in the logs: 3 Aug 05 2014 22:38:52 81.111.111.156 82.222

  • Mac Mini will not boot up at all

    Mac Mini 1.5Ghz Intel Solo, will not boot up now. It first froze when playing a song in iTunes. I shut down "the hard way." Now it can't make it past the gray boot screen. It's not even responding to any keyboard commands on boot. I can't get into Sa

  • My fm transimeter has disappeared

    My fm transimeter has disappeared when i had downloaded the newest firmware , what shall i do ?

  • Full screen photo as caller ID

    Hi, is there a way to have full screen photo as caller ID even if I have my contacts synced with gmail. Otherwise is there a way to unsync contacts without have them deleted from iPhone? Many thanks. Ciao, Andrea