Using Microsoft Excel to Create an External Table

In some cases, it may not be convenient to create your external table directly in your SQL database. The user who has the information that needs to be input into the external table may not have access to your SQL database back-end, or you may simply not be comfortable working directly with SQL management tools. Using the SQL Server Import and Export Wizard, you can create your dynamic field table data in Microsoft Excel and then import it directly into the database as a new table.

There are two steps to this process.  First, you will need to create a spreadsheet and populate it with the information that will be used by your dynamic fields. The defines the hierarchy of values that will then be used by the dynamic field. Second, you will need to import that spreadsheet into your SQL database as a new table. If you already have a spreadsheet containing the information you want to use in your dynamic fields, you can skip directly to step two.

Before you begin creating your spreadsheet, you should plan what information it will contain. See Planning Dynamic Fields for more information.

The following set of instructions explains how to create a spreadsheet in Microsoft Excel 2010, and then import it using Microsoft SQL Server Management Studio. It is intended as a model set of instructions only. If you are using another version of Excel or another database management system or database management tool, the instructions may differ.

Note: If you do not want to create your spreadsheet in Microsoft Excel, you can create it in another spreadsheet program and save it as a comma-separated list (,csv) file. You can then import the spreadsheet using the process below, but using the Flat File Source data source.

To create a Microsoft Excel spreadsheet to use with your dynamic fields

  1. Open Microsoft Excel and create a new workbook.
  2. Optional: Double-click the name of the sheet at the bottom of the screen and type a name for the sheet. This name can be automatically used to name the table.
  3. For each field you want to handle dynamically, type a column name representing that data that will be in the column.
  4. Example: A user who works at a pet store wants to create dynamic fields corresponding to types of animals, so that users can select first a category of animal (such as mammals, birds, reptiles or fish), then a type of animal (such as cats or dogs), and then a breed (such as German Shepherd or Labrador Retriever). She creates three columns: Category, Type and Breed

  5. Fill in the values you want to make available in your dynamic fields.

    Example: Once the user in the above example has created the columns, she can begin filling in the columns. The spreadsheet would look like the following example. ClosedClick to expand.

  6. Optional: If you want to create additional information that will be imported into in other tables, you can do so by creating additional sheets in the workbook.
  7. Open the File menu and select Save. Provide a save name and location for the spreadsheet.
  8. Close Microsoft Excel.

To import your Microsoft Excel spreadsheet into Microsoft SQL Server Management Studio 2008 

Important: To import a Microsoft Excel spreadsheet into your SQL database, you must use the 32-bit version of the Laserfiche Sql Server Import and Export wizard, even if you are using a 64-bit computer. Be sure to select the 32-bit version of the wizard for the import.

  1. Launch the SQL Server Import and Export Wizard in one of the following ways:
  2. In the Welcome step, click Next.
  3. In the Choose a Data Source step, open the Data source option and select Microsoft Excel.
  4. Click the Browse... button and browse to the Excel spreadsheet file you want to import.
  5. The wizard will attempt to automatically detect the version of your Excel spreadsheet in the Excel version option.  If it is unable to detect the version correctly, you can select another version from the list.
  6. If your spreadsheet was created with the column names in the first row, select First row has column names. If the first row contains data instead of column names, clear this option. Click Next to continue.
  7. In the Choose a Destination step, open the Data source option and select SQL Server Native Client 10.0.
  8. In the Server name option, select the SQL Server that hosts your Laserfiche database. (Data for dynamic fields must be stored on the same server as your Laserfiche database.)
  9. In the Authentication option, select one of the following:
  10. In the Database option, select a database.  You can use the same database as is used with your Laserfiche repository, but you do not have to. Click Next to continue.
  11. Note: If you want to create a new database to host your table, you can do so by clicking New...

  12. In the Specify Table Copy or Query step, select one of the following:
  13. Click Next to continue.
  14. Make sure that Run immediately is selected, and click Finish to complete the import.