Creating an External Table
Note: You can use Microsoft Excel to create a spreadsheet laying out your field information, and then import that Excel spreadsheet directly into your SQL Server.
Important: The Laserfiche Server service must be able to access the table or schema you are using. For Microsoft SQL Server, ensure that the user the Laserfiche Server service logs in as can access the table you have created.
Before you begin creating your external table, you should plan what information it will contain. See Planning Dynamic Fields for more information.
The following set of instructions explains how to create an external table in Microsoft SQL Server Management Studio. It is intended as a model set of instructions only. If you are using another database management system or database management tool, the instructions may differ.
To create an external table in Microsoft SQL Server Management Studio
- Launch Microsoft SQL Server Management Studio.
- Log in to the same SQL Server you use to host your Laserfiche database as a user with the rights to create and modify tables.
Important: If you select another SQL Server, your external table will not work with your repository.
- Expand your SQL Server.
- Expand Databases.
- Expand an existing database or create a new database.
Note: You can use your Laserfiche repository database, but it isn't necessary to do so.
- Select Tables.
- Right-click and select New Table.... This will open a new table definition.
- For each column, type a column name representing that data that will be in the column.
- For each column, select a relevant data type from the list.
- For each column, determine whether the column should be able to be saved with a null value.
- Repeat steps 8-10 for each column you will be using.
Example: An administrator is creating a table of employees for a Human Resources template. He creates four columns. The first has the column name "Employee Name," the type "nvarchar(64)", and does not allow nulls. The second has the column name "Department," the type "nvarchar(32)", and does not allow nulls. The third has the column name "E-mail Address," the type "nvarchar(64)", and allows nulls as some employees do not have listed email addresses. The fourth has the column name "Employee ID," the type "int", and does not allow nulls. The table definition would look like the following example.
- In the File menu, select Save Table_1 and provide a name for the table.
- Close the table definition.
- In the Tables node, select your new table. Right-click and select Edit Top 200 Rows. This will open your new table.
- Fill in the values you want to make available in your dynamic fields. Unless a column allows null value, every column must be filled in before another row can be started.
Example: Once the administrator in the above example has created the table definition, he can begin filling in the columns. The table would look like the following example.
- When you have input all the values you need, save and close your table.