Loading a CSV file to Sql Server

Hi,
How can i load a csv file, which is in a shared location itn osql using bods.
Where can i create the data source pointing to csv file

Hi,
Use fileformat to load CSV file into SQL server, below the details
A file format defines a connection to a file. Therefore, you use a file format to connect to source or target data when the data is stored in a file rather than a database table. The object library stores file format templates that you use to define specific file formats as sources and targets in data flows.
To work with file formats, perform the following tasks:
• Create a file format template that defines the structure for a file.
• Create a specific source or target file format in a data flow. The source or target file format is based on a template and specifies connection information such as the file name.
File format objects can describe files of the following types:
• Delimited: Characters such as commas or tabs separate each field.
• Fixed width: You specify the column width.
• SAP transport: Use to define data transport objects in SAP application data flows.
• Unstructured text: Use to read one or more files of unstructured text from a directory.
• Unstructured binary: Use to read one or more binary documents from a directory.
More details, refer the designer guide
http://help.sap.com/businessobject/product_guides/sbods42/en/ds_42_designer_en.pdf

Similar Messages

  • Issue while loading a csv file using sql*loader...

    Hi,
    I am loading a csv file using sql*loader.
    On the number columns where there is data populated in them, decimal number/integers, the row errors out on the error -
    ORA-01722: invalid number
    I tried checking the value picking from the excel,
    and found the chr(13),chr(32),chr(10) values characters on the value.
    ex: select length('0.21') from dual is giving a value of 7.
    When i checked each character as
    select ascii(substr('0.21',5,1) from dual is returning a value 9...etc.
    I tried the following command....
    "to_number(trim(replace(replace(replace(replace(:std_cost_price_scala,chr(9),''),chr(32),''),chr(13),''),chr(10),'')))",
    to remove all the non-number special characters. But still facing the error.
    Please let me know, any solution for this error.
    Thanks in advance.
    Kiran

    control file:
    OPTIONS (ROWS=1, ERRORS=10000)
    LOAD DATA
    CHARACTERSET WE8ISO8859P1
    INFILE '$Xx_TOP/bin/ITEMS.csv'
    APPEND INTO TABLE XXINF.ITEMS_STAGE
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
    ItemNum                    "trim(replace(replace(:ItemNum,chr(9),''),chr(13),''))",
    cross_ref_old_item_num               "trim(replace(replace(:cross_ref_old_item_num,chr(9),''),chr(13),''))",
    Mas_description               "trim(replace(replace(:Mas_description,chr(9),''),chr(13),''))",
    Mas_long_description               "trim(replace(replace(:Mas_long_description,chr(9),''),chr(13),''))",
    Org_description               "trim(replace(replace(:Org_description,chr(9),''),chr(13),''))",
    Org_long_description               "trim(replace(replace(:Org_long_description,chr(9),''),chr(13),''))",
    user_item_type                    "trim(replace(replace(:user_item_type,chr(9),''),chr(13),''))",
    organization_code               "trim(replace(replace(:organization_code,chr(9),''),chr(13),''))",
    primary_uom_code               "trim(replace(replace(:primary_uom_code,chr(9),''),chr(13),''))",
    inv_default_item_status          "trim(replace(replace(:inv_default_item_status,chr(9),''),chr(13),''))",
    inventory_item_flag               "trim(replace(replace(:inventory_item_flag,chr(9),''),chr(13),''))",
    stock_enabled_flag               "trim(replace(replace(:stock_enabled_flag,chr(9),''),chr(13),''))",
    mtl_transactions_enabled_flag          "trim(replace(replace(:mtl_transactions_enabled_flag,chr(9),''),chr(13),''))",
    revision_qty_control_code          "trim(replace(replace(:revision_qty_control_code,chr(9),''),chr(13),''))",
    reservable_type               "trim(replace(replace(:reservable_type,chr(9),''),chr(13),''))",
    check_shortages_flag               "trim(replace(replace(:check_shortages_flag,chr(9),''),chr(13),''))",
    shelf_life_code               "trim(replace(replace(replace(replace(:shelf_life_code,chr(9),''),chr(13),''),chr(32),''),chr(10),''))",
    shelf_life_days               "trim(replace(replace(replace(replace(:shelf_life_days,chr(9),''),chr(13),''),chr(32),''),chr(10),''))",
    lot_control_code               "trim(replace(replace(:lot_control_code,chr(9),''),chr(13),''))",
    auto_lot_alpha_prefix               "trim(replace(replace(:auto_lot_alpha_prefix,chr(9),''),chr(13),''))",
    start_auto_lot_number               "trim(replace(replace(:start_auto_lot_number,chr(9),''),chr(13),''))",
    negative_measurement_error          "trim(replace(replace(replace(replace(:negative_measurement_error,chr(9),''),chr(13),''),chr(32),''),chr(10),''))",
    positive_measurement_error          "trim(replace(replace(replace(replace(:positive_measurement_error,chr(9),''),chr(13),''),chr(32),''),chr(10),''))",
    serial_number_control_code          "trim(replace(replace(:serial_number_control_code,chr(9),''),chr(13),''))",
    auto_serial_alpha_prefix          "trim(replace(replace(:auto_serial_alpha_prefix,chr(9),''),chr(13),''))",
    start_auto_serial_number          "trim(replace(replace(:start_auto_serial_number,chr(9),''),chr(13),''))",
    location_control_code               "trim(replace(replace(:location_control_code,chr(9),''),chr(13),''))",
    restrict_subinventories_code          "trim(replace(replace(:restrict_subinventories_code,chr(9),''),chr(13),''))",
    restrict_locators_code               "trim(replace(replace(:restrict_locators_code,chr(9),''),chr(13),''))",
    bom_enabled_flag               "trim(replace(replace(:bom_enabled_flag,chr(9),''),chr(13),''))",
    costing_enabled_flag               "trim(replace(replace(:costing_enabled_flag,chr(9),''),chr(13),''))",
    inventory_asset_flag               "trim(replace(replace(:inventory_asset_flag,chr(9),''),chr(13),''))",
    default_include_in_rollup_flag          "trim(replace(replace(:default_include_in_rollup_flag,chr(9),''),chr(13),''))",
    cost_of_goods_sold_account          "trim(replace(replace(:cost_of_goods_sold_account,chr(9),''),chr(13),''))",
    std_lot_size                    "trim(replace(replace(replace(replace(:std_lot_size,chr(9),''),chr(13),''),chr(32),''),chr(10),''))",
    sales_account                    "trim(replace(replace(:sales_account,chr(9),''),chr(13),''))",
    purchasing_item_flag               "trim(replace(replace(:purchasing_item_flag,chr(9),''),chr(13),''))",
    purchasing_enabled_flag          "trim(replace(replace(:purchasing_enabled_flag,chr(9),''),chr(13),''))",
    must_use_approved_vendor_flag          "trim(replace(replace(:must_use_approved_vendor_flag,chr(9),''),chr(13),''))",
    allow_item_desc_update_flag          "trim(replace(replace(:allow_item_desc_update_flag,chr(9),''),chr(13),''))",
    rfq_required_flag               "trim(replace(replace(:rfq_required_flag,chr(9),''),chr(13),''))",
    buyer_name                    "trim(replace(replace(:buyer_name,chr(9),''),chr(13),''))",
    list_price_per_unit               "trim(replace(replace(replace(replace(:list_price_per_unit,chr(9),''),chr(13),''),chr(32),''),chr(10),''))",
    taxable_flag                    "trim(replace(replace(:taxable_flag,chr(9),''),chr(13),''))",
    purchasing_tax_code               "trim(replace(replace(:purchasing_tax_code,chr(9),''),chr(13),''))",
    receipt_required_flag               "trim(replace(replace(:receipt_required_flag,chr(9),''),chr(13),''))",
    inspection_required_flag          "trim(replace(replace(:inspection_required_flag,chr(9),''),chr(13),''))",
    price_tolerance_percent          "trim(replace(replace(replace(replace(:price_tolerance_percent,chr(9),''),chr(13),''),chr(32),''),chr(10),''))",
    expense_account               "trim(replace(replace(:expense_account,chr(9),''),chr(13),''))",
    allow_substitute_receipts_flag          "trim(replace(replace(:allow_substitute_receipts_flag,chr(9),''),chr(13),''))",
    allow_unordered_receipts_flag          "trim(replace(replace(:allow_unordered_receipts_flag,chr(9),''),chr(13),''))",
    receiving_routing_code               "trim(replace(replace(:receiving_routing_code,chr(9),''),chr(13),''))",
    inventory_planning_code          "trim(replace(replace(:inventory_planning_code,chr(9),''),chr(13),''))",
    min_minmax_quantity               "trim(replace(replace(replace(replace(:min_minmax_quantity,chr(9),''),chr(13),''),chr(32),''),chr(10),''))",
    max_minmax_quantity               "trim(replace(replace(replace(replace(:max_minmax_quantity,chr(9),''),chr(13),''),chr(32),''),chr(10),''))",
    planning_make_buy_code               "trim(replace(replace(:planning_make_buy_code,chr(9),''),chr(13),''))",
    source_type                    "trim(replace(replace(:source_type,chr(9),''),chr(13),''))",
    mrp_safety_stock_code               "trim(replace(replace(:mrp_safety_stock_code,chr(9),''),chr(13),''))",
    material_cost                    "trim(replace(replace(:material_cost,chr(9),''),chr(13),''))",
    mrp_planning_code               "trim(replace(replace(:mrp_planning_code,chr(9),''),chr(13),''))",
    customer_order_enabled_flag          "trim(replace(replace(:customer_order_enabled_flag,chr(9),''),chr(13),''))",
    customer_order_flag               "trim(replace(replace(:customer_order_flag,chr(9),''),chr(13),''))",
    shippable_item_flag               "trim(replace(replace(:shippable_item_flag,chr(9),''),chr(13),''))",
    internal_order_flag               "trim(replace(replace(:internal_order_flag,chr(9),''),chr(13),''))",
    internal_order_enabled_flag          "trim(replace(replace(:internal_order_enabled_flag,chr(9),''),chr(13),''))",
    invoice_enabled_flag               "trim(replace(replace(:invoice_enabled_flag,chr(9),''),chr(13),''))",
    invoiceable_item_flag               "trim(replace(replace(:invoiceable_item_flag,chr(9),''),chr(13),''))",
    cross_ref_ean_code               "trim(replace(replace(:cross_ref_ean_code,chr(9),''),chr(13),''))",
    category_set_intrastat               "trim(replace(replace(:category_set_intrastat,chr(9),''),chr(13),''))",
    CustomCode                    "trim(replace(replace(:CustomCode,chr(9),''),chr(13),''))",
    net_weight                    "trim(replace(replace(replace(replace(:net_weight,chr(9),''),chr(13),''),chr(32),''),chr(10),''))",
    production_speed               "trim(replace(replace(:production_speed,chr(9),''),chr(13),''))",
    LABEL                         "trim(replace(replace(:LABEL,chr(9),''),chr(13),''))",
    comment1_org_level               "trim(replace(replace(:comment1_org_level,chr(9),''),chr(13),''))",
    comment2_org_level               "trim(replace(replace(:comment2_org_level,chr(9),''),chr(13),''))",
    std_cost_price_scala               "to_number(trim(replace(replace(replace(replace(:std_cost_price_scala,chr(9),''),chr(32),''),chr(13),''),chr(10),'')))",
    supply_type                    "trim(replace(replace(:supply_type,chr(9),''),chr(13),''))",
    subinventory_code               "trim(replace(replace(:subinventory_code,chr(9),''),chr(13),''))",
    preprocessing_lead_time          "trim(replace(replace(replace(replace(:preprocessing_lead_time,chr(9),''),chr(32),''),chr(13),''),chr(10),''))",
    processing_lead_time                "trim(replace(replace(replace(replace(:processing_lead_time,chr(9),''),chr(32),''),chr(13),''),chr(10),''))",
    wip_supply_locator               "trim(replace(replace(:wip_supply_locator,chr(9),''),chr(13),''))"
    Sample data from csv file.
    "9901-0001-35","390000","JMKL16 Pipe bend 16 mm","","JMKL16 Putkikaari 16 mm","","AI","FJE","Ea","","","","","","","","","","","","","","","","","","","","","","","","","21-21100-22200-00000-00000-00-00000-00000","0","21-11100-22110-00000-00000-00-00000-00000","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","0.1","Pull","AFTER PROD","","","Locator for Production"
    The load errors out on especially two columns :
    1) std_cost_price_scala
    2) list_price_per_unit
    both are number columns.
    And when there is data being provided on them. It errors out. But, if they are holding null values, the records go through fine.
    Message was edited by:
    KK28

  • 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

  • How to extract data from multiple flat files to load into corresponding tables in SQL Server 2008 R2 ?

    Hi,
              I have to implement the following scenario in SSIS but don't know how to do since I never worked with SSIS before. Please help me.
              I have 20 different text files in a single folder and 20 different tables corresponding to each text file in SQL Server 2008 R2 Database. I need to extract the data from each text file and
    load the data into corresponding table in Sql Server Database. Please guide me in how many ways I can do this and which is the best way to implement this job.  Actually I have to automate this job. Few files are in same format(with same column names
    and datatypes) where others are not.
    1. Do I need to create 20 different projects ?
                   or
        Can I implement this in only one project by having 20 packages?
                 or
        Can I do this in one project with only one package?
    Thanks in advance.

    As I said I don't know how to use object data type, I just given a shot as below. I know the following code has errors can you please correct it for me.
    Public
    Sub Main()
    ' Add your code here 
    Dim f1
    As FileStream
    Dim s1
    As StreamReader
    Dim date1
    As
    Object
    Dim rline
    As
    String
    Dim Filelist(1)
    As
    String
    Dim FileName
    As
    String
    Dim i
    As
    Integer
    i = 1
    date1 =
    Filelist(0) =
    "XYZ"
    Filelist(1) =
    "123"
    For
    Each FileName
    In Filelist
    f1 = File.OpenRead(FileName)
    s1 = File.OpenText(FileName)
    rline = s1.ReadLine
    While
    Not rline
    Is
    Nothing
    If Left(rline, 4) =
    "DATE"
    Then
    date1 (i)= Mid(rline, 7, 8)
     i = i + 1
    Exit
    While
    End
    If
    rline = s1.ReadLine
    End
    While
    Next
    Dts.Variables(
    "date").Value = date1(1)
    Dts.Variables(
    "date1").Value = date1(2)
    Dts.TaskResult = ScriptResults.Success
    End
    Sub

  • Using SQL*Loader to load a .csv file having multiple CLOBs

    Oracle 8.1.5 on Solaris 2.6
    I want to use SQL*Loader to load a .CSV file that has 4 inline CLOB columns. I shall attempt to give some information about the problem:
    1. The CLOBs are not delimited in the field level and could themselves contain commas.
    2. I cannot get the data file in any other format.
    Can anybody help me out with this? While loading LOB in predetermined size fields, is there a limit on the size?
    TIA.
    -Murali

    Thanks for the article link. The article states "...the loader can load only XMLType tables, not columns." Is this still the case with 10g R2? If so, what is the best way to workaround this problem? I am migrating data from a Sybase table that contains a TEXT column (among others) to an Oracle table that contains an XMLType column. How do you recommend I accomplish this task?
    - Ron

  • How to save CSV file in application server while making infospoke

    How to save CSV file in application server to be used as destination while making infospoke.
    Please give the steps.........

    Hi
    If you want to load your flatfile from Application server,then you need to trasfer your file from your desktop(Computer) to Application server by using FTP.
    Try using ARCHIVFILE_CLIENT_TO_SERVER Function module.
    You Just need to give thesource path and the target path
    goto SE37 t-code , which is Function module screen, give the function name ARCHIVFILE_CLIENT_TO_SERVER, on click F8 Execute button.
    for path variable give the file path where it resides like C:\users\xxx\desktop\test.csv
    for target path give the directory path on Application server: /data/bi_data
    remember the directory in Server starts with /.
    U have to where to place the file.
    Otherwise use 3rd party tools to connect to ur appl server like : Core FTP and Absolute FTP in google.
    Otherwise...
    Goto the T.code AL11. From there, you can find the directories available in the Application Server.
    For example, if you wanna save the file in the directory "DIR_HOME", then you can find the path of the directories in the nearby column. With the help of this, you can specify the target path. Specify the target path with directory name followed by the filename with .CSV extension.
    Hope this helps
    regards
    gaurav

  • Error: java.lang.OutOfMemoryError when uploading CSV files to web server

    Hi experts,
    I have made a JSP page from which clients load csv files to web server. I am using Tomca 4.1 as my web server and JDK 1.3.1_09.
    The system works fine when uploadiing small csv files, but it crashes when uploading large CSV files.
    It gives me the following error:
    java.lang.OutOfMemoryError
         <<no stack trace available>>
    This is the code that I used to load files....
    <%
    String saveFile = "";
    String contentType = request.getContentType();
    if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0))
         DataInputStream in = new DataInputStream(request.getInputStream());
         int formDataLength = request.getContentLength();
         byte dataBytes[] = new byte[formDataLength];
         int byteRead = 0;
         int totalBytesRead = 0;
         while (totalBytesRead < formDataLength)
              byteRead = in.read(dataBytes, totalBytesRead, formDataLength);
              totalBytesRead += byteRead;
         String file = new String(dataBytes);
         saveFile = file.substring(file.indexOf("filename=\"") + 10);
         saveFile = saveFile.substring(0, saveFile.indexOf("\n"));
         saveFile = saveFile.substring(saveFile.lastIndexOf("\\") + 1,saveFile.indexOf("\""));
         int lastIndex = contentType.lastIndexOf("=");
         String boundary = contentType.substring(lastIndex + 1,contentType.length());
         int pos;
         pos = file.indexOf("filename=\"");
         pos = file.indexOf("\n", pos) + 1;
         pos = file.indexOf("\n", pos) + 1;
         pos = file.indexOf("\n", pos) + 1;
         int boundaryLocation = file.indexOf(boundary, pos) - 4;
         int startPos = ((file.substring(0, pos)).getBytes()).length;
         int endPos = ((file.substring(0, boundaryLocation)).getBytes()).length;
         String folder = "f:/Program Files/Apache Group/Tomcat 4.1/webapps/broadcast/file/";
         //String folder = "10.28.12.58/bulksms/";
         FileOutputStream fileOut = new FileOutputStream(folder + saveFile);
         //out.print("Saved here: " + saveFile);
         //fileOut.write(dataBytes);
         fileOut.write(dataBytes, startPos, (endPos - startPos));
         fileOut.flush();
         fileOut.close();
         out.println("File loaded successfully");
    //f:/Program Files/Apache Group/Tomcat 4.1/webapps/sms/file/
    %>
    Please can anyone help me solve this problem for me...
    Thanx...
    Deepak

    I know it may be hard to throw away all this code, but consider using the jakarta fileupload component.
    I think it would simplify your code down to
    // Create a factory for disk-based file items
    FileItemFactory factory = new DiskFileItemFactory();
    // Create a new file upload handler
    ServletFileUpload upload = new ServletFileUpload(factory);
    // Parse the request
    List /* FileItem */ items = upload.parseRequest(request);
    // Process the uploaded items
    Iterator iter = items.iterator();
    while (iter.hasNext()) {
        FileItem item = (FileItem) iter.next();
        if (item.isFormField()) {
            processFormField(item);
        } else {
            // item is a file.  write it
            File saveFolder = application.getRealPath("/file");          
            File uploadedFile = new File(saveFolder, item.getName());
            item.write(uploadedFile);
    }Most of this code was hijacked from http://jakarta.apache.org/commons/fileupload/using.html
    Check it out. It will solve your memory problem by writing the file to disk temporarily if necessary.
    Cheers,
    evnafets

  • 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]

  • Error loading local CSV file into external table

    Hello,
    I am trying to load a CSV file located on my C:\ drive on a WIndows XP system into an 'external table'. Everyting used to work correctly when using Oracle XE (iinstalled also locally on my WIndows system).
    However, once I am trynig to load the same file into a Oracle 11g R2 database on UNIX, I get the following errr:
    ORA-29913: Error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    error opening file ...\...\...nnnnn.log
    Please let me know if I can achieve the same functionality I had with Oracle XP.
    (Note: I cannot use SQL*Loader approach, I am invoking Oracle stored procedures from VB.Net that are attempting to load data into external tables).
    Regards,
    M.R.

    user7047382 wrote:
    Hello,
    I am trying to load a CSV file located on my C:\ drive on a WIndows XP system into an 'external table'. Everyting used to work correctly when using Oracle XE (iinstalled also locally on my WIndows system).
    However, once I am trynig to load the same file into a Oracle 11g R2 database on UNIX, I get the following errr:
    ORA-29913: Error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    error opening file ...\...\...nnnnn.log
    Please let me know if I can achieve the same functionality I had with Oracle XP.
    (Note: I cannot use SQL*Loader approach, I am invoking Oracle stored procedures from VB.Net that are attempting to load data into external tables).
    Regards,
    M.R.So your database is on a unix box, but the file is on your Windows desktop machine? So .... how is it you are making your file (on your desktop) visible to your database (on a unix box)???????

  • Tempdb in a subdirectory of \Program Files\Microsoft SQL Server\

    Hi,
    SAP ERP 6.0 / Sol. Man. 4.0 Installation Guide say "after initial installation of the database software, the <b>tempdb</b> is located in a subdirectory of <b>\Program Files\Microsoft SQL Server</b>. However later, when SAPinst builds and loads the database, it is transferred to a new <b>\TEMPDB</b> directory and extended to a size of 300 MB."
    I finished the installation some days ago but I still see file tempdb.mdf & templog.ldf in
    C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
    May I delete these files because tempdb DB currently use the 2 files in <b>\TEMPDB directory</b>?
    Regards,
    Toan Do

    HI,
    <b>Moving the tempdb database</b>
    As the tempdb database is constantly being used by the SQL Server, it cannot be moved using the same process described above (sp_detach_db, sp_attach_db). Instead, you must use the 'alter database modify file' command.
    a) First display all tempdb database files using the following command:
    select convert(char(20),name) as name, filename from tempdb..sysfiles
    name      filename
    tempdev    d:\TEMPDB\TEMPDB.MDF
    templog    d:\TEMPDB\TEMPLOG.LDF
    (2 row(s) affected)
    b) Set a new storage location for the files by executing an ALTER DATABASE for each file:
    Example:
    alter database tempdb
          modify file (name=tempdev,filename='E:\NEW\tempdb.mdf')
    alter database tempdb
          modify file (name=templog,filename='E:\NEW\templog.ldf')
    c) Restart your SQL Server. The tempdb database is created again during each restart of the SQL Server. In this case, the files are now created in the new directory.
    <b>d) Use the NT Explorer to delete the old database files for the tempdb.</b>
    e) We recommend that you make a full backup of the master database after the change.
    <b>Refrence SAP Note:</b>
    Note 363018 - File management with SQL Server.
    Award points if helpful.
    Thanks,
    Tanuj

  • How to link Excel 2010 .XLSX file to SQL server 2008R2 - a method that actually works?

    I have been trying unsuccessfully to link my excel file to SQL server like I used to with SQL 2005.
    In SQL 2008R2 I have installed the 64-bit data access components from Office 2010 to get the  provider 'Microsoft.ACE.OLEDB.12.0' avilable.
    When I try this command:
    SELECT
    FROM
    OPENDATASOURCE(
    'Microsoft.ACE.OLEDB.12.0',
    'Data Source="E:\ADUpdates\Employee List1.xlsx"; Extended properties=Excel 12.0')...[Sheet1$]
    I get this error:
    Msg 7399, Level 16, State 1, Line 1
    The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" reported an error. Access denied.
    Msg 7301, Level 16, State 2, Line 1
    Cannot obtain the required interface ("IID_IDBCreateCommand") from OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".
    The Access Denied error seems to be form the worksheet and not the file itself. Evidence is that if I enter a bogus sheet name it tells me the sheet doesn't exist and after this error the file is locked open and can't be saved again from Excel until the
    query windows is closed. The sheet is not protected in Excel so I don't know how access to it can be denied.
    Does anyone actually have this working in SQL 2008R2?

    Some minor progress on this issue by running SQL Server service under a domain account with Administrator priv on the SQL server.
    This query now works in a query window:
    SELECT * FROM OPENDATASOURCE( 'Microsoft.ACE.OLEDB.12.0', 'Data Source="E:\ADUpdates\Employee List.xlsx"; Extended properties=Excel 12.0')...[EmployeeData];
    However, creating a Linked server object for the same spreadsheet still does not work:
    EXEC master.dbo.sp_addlinkedserver @server = N'TEST', @srvproduct=N'Excel 12.0', @provider=N'Microsoft.ACE.OLEDB.12.0', @datasrc=N'E:\ADUpdates\Employee List.xlsx'
    The test connection to the linked server failed.
    Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "TEST".
    OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "TEST" returned message "Unrecognized database format 'E:\ADUpdates\Employee List.xlsx'.". (Microsoft SQL Server, Error: 7303)
    For help, click:
    http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600&EvtSrc=MSSQLServer&EvtID=7303&LinkId=20476
    Naturally, the help link provided only confirms the contempt microsoft holds for their customers by not providing any information at all.
    (appologies for the weird colour and fonts, this is a microsoft product, just have to live with obvious defects).

  • Error while loading a CSV file

    Haii,
    While loading a csv file in Open Script I'm facing with the foll: error.
    Error loading the CSV file Caused by: java.io.SocketException occurred.
    Can anyone please help me sort it out.
    Thank You

    Hi,
    Are you creating a table and loading it in Openscript??
    If so, can you show the screen shot.
    One more information , you can also change the Excel sheet into a CSV file and you can add it as a databank in the Tree view of the Openscript.
    Thanks and Regards,
    Nishanth Soundararajan.

  • Problem attaching mdf file in sql server 2008

    hi...!
    I have an mdf file of sql server 2005 database now i want it to attach in sql server 2008 R2 but when i try to attach it, it gave me error saying.
       Fail to retrieve data for this request. 
     An exception occur while executing a Transact-SQL statement or batch.(Microsoft.sqlServer.connectionInfo)
    C:\program files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\file6.mdf is not a primary database file. (Microsoft SQL Server, Error:5171)
    Thanks in advance

    hi...!
    I have an mdf file of sql server 2005 database now i want it to attach in sql server 2008 R2 but when i try to attach it, it gave me error saying.
       Fail to retrieve data for this request. 
     An exception occur while executing a Transact-SQL statement or batch.(Microsoft.sqlServer.connectionInfo)
    C:\program files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\file6.mdf is not a primary database file. (Microsoft SQL Server, Error:5171)
    Thanks in advance
    Hello,
    As the message says the file is not primary data file ,i guess it must be ndf(secondary data file) or some other file you might have selected by mistake.PLease select primary data file and try attching you will succed
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • Urgent: loading a pdf file  to presentation server at the end of the day

    hi
    I got a requirement like smartform will be converted into pdf file and it will loaded into application server, at the End of the day all the pdf files which are generated on that day will be loaded to in file at presentation server ,
    so please help me out regarding
    Thanks in advance
    regards
    krishna

    Hi Chris,
    this problems are in fact new to me, but I'm just starting on a new workplace where they have these issues since forever.
    I'm hoping that new point of view may find a solution to it ;-)
    I'll try to watch the traffic - it could be related to the particular network we have. Will ask and post some more info tomorrow.
    Thank you!
    /best
    /j

  • Error in sql_engine_core_inst_Cpu64_1.log file for SQL Server 2012

    I was running SQL Server 2012 in Win 7 64 bit OS. Some how I found SQLSERVER server is not running and I was not able to run the service. Then I tried to unisntall and install again. And I found that some of the SQL Server
    features got failed,  like: Reporting Services - Native, Database Engine Services, Data Quality Services, Full-Text and Semantic Extractions for Search and SQL Server Replication. I checked the Summary.txt
    file from location C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log. It thsi logs referes to another log file location like: 
    Feature:                       Database Engine Services
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred during the setup process of the feature.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Database Engine Services Instance Features
      Component error code:          1639
      Component log file:            C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20140127_151409\sql_engine_core_inst_Cpu64_1.log
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=sql_engine_core_inst.msi%400x162A16FE%400x1639
    I did unisntall/install multipel times. But fhw to fix the issue that saying in sql_engine_core_inst_Cpu64_1.log file.: 
    === Verbose logging started: 1/27/2014  15:45:04  Build type: SHIP UNICODE 5.00.7601.00  Calling process: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\SQLServer2012\x64\ScenarioEngine.exe ===
    MSI (c) (C4:BC) [15:45:04:321]: Resetting cached policy values
    MSI (c) (C4:BC) [15:45:04:321]: Machine policy value 'Debug' is 0
    MSI (c) (C4:BC) [15:45:04:321]: ******* RunEngine:
               ******* Product: E:\Software\SQL Full Installation\x64\setup\sql_engine_core_inst_msi\sql_engine_core_inst.msi
               ******* Action: 
               ******* CommandLine: **********
    MSI (c) (C4:BC) [15:45:04:322]: Client-side and UI is none or basic: Running entire install on the server.
    MSI (c) (C4:BC) [15:45:04:322]: Grabbed execution mutex.
    MSI (c) (C4:BC) [15:45:04:323]: Cloaking enabled.
    MSI (c) (C4:BC) [15:45:04:323]: Attempting to enable all disabled privileges before calling Install on Server
    MSI (c) (C4:BC) [15:45:04:323]: Incrementing counter to disable shutdown. Counter after increment: 0
    MSI (s) (38:8C) [15:45:04:327]: Running installation inside multi-package transaction E:\Software\SQL Full Installation\x64\setup\sql_engine_core_inst_msi\sql_engine_core_inst.msi
    MSI (s) (38:8C) [15:45:04:327]: Grabbed execution mutex.
    MSI (s) (38:A0) [15:45:04:327]: Resetting cached policy values
    MSI (s) (38:A0) [15:45:04:327]: Machine policy value 'Debug' is 0
    MSI (s) (38:A0) [15:45:04:327]: ******* RunEngine:
               ******* Product: E:\Software\SQL Full Installation\x64\setup\sql_engine_core_inst_msi\sql_engine_core_inst.msi
               ******* Action: 
               ******* CommandLine: **********
    MSI (s) (38:A0) [15:45:04:452]: Machine policy value 'TransformsSecure' is 0
    MSI (s) (38:A0) [15:45:04:452]: User policy value 'TransformsAtSource' is 0
    MSI (s) (38:A0) [15:45:04:475]: Machine policy value 'DisableUserInstalls' is 0
    MSI (s) (38:A0) [15:45:04:475]: Specified instance {18B2A97C-92C3-4AC7-BE72-F823E0BC895B} via transform :InstID01.mst;:InstName02.mst is already installed. MSINEWINSTANCE requires a new instance that is not installed.
    MSI (s) (38:A0) [15:45:04:475]: MainEngineThread is returning 1639
    MSI (s) (38:8C) [15:45:04:477]: User policy value 'DisableRollback' is 0
    MSI (s) (38:8C) [15:45:04:477]: Machine policy value 'DisableRollback' is 0
    MSI (s) (38:8C) [15:45:04:477]: Incrementing counter to disable shutdown. Counter after increment: 0
    MSI (s) (38:8C) [15:45:04:478]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\InProgress 3: 2 
    MSI (s) (38:8C) [15:45:04:478]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\InProgress 3: 2 
    MSI (s) (38:8C) [15:45:04:478]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied.  Counter after decrement: -1
    MSI (s) (38:8C) [15:45:04:478]: Restoring environment variables
    MSI (c) (C4:BC) [15:45:04:481]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied.  Counter after decrement: -1
    MSI (c) (C4:BC) [15:45:04:481]: MainEngineThread is returning 1639
    === Verbose logging stopped: 1/27/2014  15:45:04 ===
    Please advice. I searched many places and did not get actual solution that will resolve my case.
    Nusrat Akhter

    Hi Nusrat Akhter,
    According to your description, when installing the first install failed, and it looks like the instance did not uninstall completely. To solve the issue I recommend you changed the instance name in re-installing SQL Server, and check if it can work fine.
    There is a similar issue that the SQL engine will not start, and there is no method of uninstalling either it, or any of the components etc. You can review the following post.
    https://connect.microsoft.com/SQLServer/feedback/details/710892/sql-server-2012-rc0-install-fails-citing-invalid-drivers
    Thanks,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

Maybe you are looking for

  • How do I move photos from iphone to my computer

    How do I move photos from iphone to my computer? I have backed up the phone, but don't know how to look into my desktop to confirm the photos are all there.

  • Ipad cover doesn't allow swipe up for airplay on ios7

    Help! I have downloaded ios7 on all our school ipads and because of the shape of our ipad covers, can no longer access airplay. We cannot swipe up as the cover is too chunky. Does anyone know of another way to access airplay other than the swipe up??

  • How to use currnet date in check constraint

    Hi Would you help me with this? create table test_1 ( xxx number (1), yyy number(1), zzz number(1), sss date check (sss < .......));Thank you in advance for your help

  • Delphi OLE automation to read/write in SAP

    Hi, i want to develop a macro in Delphi for reading and writng values on a SAP gui, i've found very llittle documentation on how to do this, i know how to create the ole object and and initialize the session but i can't read or write the values shown

  • Place an element from library to document

    I know the name of library and name of element. How can my script place an element from library to document at any location?