SQL Server Performance

Export Wizard exports 0 records

Discussion in 'SQL Server 2005 General Developer Questions' started by jbates99, Nov 12, 2009.

  1. jbates99 Member

    Hi experts,

    Using 2005's Export wizard to do a quick, ad-hoc report.
    When I run the query it does select 15 rows, but the same query inside the Export Wizard does not retrieve any records - get a blank report.

    The execution was successful

    - Initializing Data Flow Task (Success)

    - Initializing Connections (Success)

    - Setting SQL Command (Success)

    - Setting Source Connection (Success)

    - Setting Destination Connection (Success)

    - Validating (Success)

    - Prepare for Execute (Success)

    - Pre-execute (Success)
    Information 0x402090dc: Data Flow Task: The processing of file "C:RamcoDatabaseUsers.txt" has started.
    (SQL Server Import and Export Wizard)

    - Executing (Success)

    - Copying to C:RamcoDatabaseUsers.txt (Success)
    0 rows transferred

    - Post-execute (Success)
    Information 0x402090dd: Data Flow Task: The processing of file "C:RamcoDatabaseUsers.txt" has ended.
    (SQL Server Import and Export Wizard)

    - Cleanup (Success)
    Information 0x4004300b: Data Flow Task: "component "Destination - RamcoDatabaseUsers_txt" (28)" wrote 0 rows. (SQL Server Import and Export Wizard)

    Thanks for any ideas. John

  2. satya Moderator

    Ensure that the target table matches the columns from source, though the query executes successfully it may error out due to mistmatch of columns.
  3. jbates99 Member

    Thanks for the suggestion, Satya.

    Yes, the source columns match the target columns exactly - even the dataTypes are the same.

    In design Mode, the 'Preview Query results' window shows the rows that *should* be written to the report.

    When i execute the package, The Execution Results tab shows "Flat File Destination Component wrote 0 rows"

    A .txt file does get created but it is blank.

    I am lost on this one.....

  4. satya Moderator

    Do you have any REferential integrity or foreign key constraint that is restricting the rows to import?
  5. jbates99 Member


    I'm exporting to a text file, so I don't think referential integrity could be the casue of not selecting any records. My input table is in the master database.

    And my post says I'm using the Export Wizard but I have tried an SSIS package as well - still get a blank report file.

    Thanks, John
  6. jbates99 Member

    Thanks for your ideas, Satya.

    This is what caused it to not select any rows...... I had "Use master;" as the first line. I removed that line and ran it - now it selects the appropriate rows.

    Just wanted to post back with the solution.


Share This Page