Creating a Card List from an SQL Source

You can create a card list by setting up a T-SQL query that retrieves values from an external database; for example, a materials database or list of customer names.

The queries use the standard Microsoft T-SQL formatting. See the SQL Server Books Online for help on how to write queries.

SOLIDWORKS PDM lists can only show values in one column. If the SQL Query returns more than one result column, only values from the first column are used.

SQL lists are refreshed by the SOLIDWORKS PDM database server service that runs on the SQL server hosting the SOLIDWORKS PDM vault where lists are defined. If list updates fail, ensure that the service is installed and configured correctly.

To create a card list from a SQL source:

  1. Determine where the SQL data should be retrieved from. Use the SQL Server Management Studio to locate table names and try the query.
  2. Use the SQL Server Management Studio to locate table names and try the query.
  3. Right-click Lists (for cards) and select Add New.
  4. In the dialog box, type a List name.
  5. For Data type, select From SQL Database.
  6. Under SQL command returning the data, type the SQL query that selects the list values from the database table.
  7. For Server, type the IP address or name of the SQL server hosting the database.
  8. For Database, type the name of the SQL database containing the list values.
  9. Type the login name and password of the SQL user.
  10. To test the SQL query and connection information, click Test.

    If successful, a list of values from the SQL source appears in the Values window.

  11. To complete the list, click File > Save.
  12. To link the list to a card, create or edit a data card.
  13. Add a control to use the list.
  14. In the properties pane, under Items, select Special value and select the SQL-based list.
When a user uses the data card, the values of the control are derived from the list returned by the SQL query.