Ukryj spis treści

Retrieving SQL Values from a Linked Server Source

By configuring a linked server in SQL server, you can retrieve data from many external data sources such as MS Access, Excel, or other database types.

To populate Enterprise PDM lists with data contained in an Excel workbook, you would have to first configure an Excel data source as a linked server in SQL Server, then query the linked server for desired information.

For more information on linked servers and distributed queries, please consult the following Microsoft Knowledge Base article: http://support.microsoft.com/kb/306397

Excel must be installed on the server that has the SQL server installed.

To configure an Excel data source as a linked server in SQL Server 2005:

  1. In SQL Server Management Studio, in the Object Explorer pane, expand Server Objects.
  2. Right-click Linked Server and select New Linked Server.
  3. To create a new linked server, in the left pane, in the General property page:
    1. Type any name for the linked server. You should choose a name similar to the name of the Excel worksheet for easier reference. In this example the name "MY_EXCEL_WORKBOOK_LINKED_SERVER" is used.
    2. Select Other data source.
    3. In the Provider list, click Microsoft Jet 4.0 OLE DB Provider.
    4. For Product Name, type Excel for the name of the OLE DB data source.
    5. For Data Source, type the full path and file name of the Excel document, for example: C:\EngineeringData\My_Excel_Workbook.xls.
    6. For Provider String, type Excel 8.0 for an Excel 97, 2000, or 2002 workbook.
    7. Click OK.
  4. Query the Excel data source on the linked server.

    For example, to retrieve the fields in the 'PartNumber' column stored in Sheet1 of your Excel file you can use the following code: SELECT PartNumber FROM MY_EXCEL_WORKBOOK_LINKED_SERVER...Sheet1$

You can use the above SQL Query in an Enterprise PDM list with a data type "From SQL Database" and set it to refresh every X minutes to retrieve the PartNumbers from the Excel file into Enterprise PDM.

You must enter a database name (any existing database on the server will do, for example the Northwind sample database or the file vault database), and the server and login credentials of the SQL server with the linked server.



Wyraź swoje opinie dotyczące tego tematu

SOLIDWORKS docenia wszelkie informacje i uwagi dostarczone przez użytkownika na temat prezentacji, dokładności oraz prawidłowości dokumentacji. Proszę użyć poniższego formularza, aby wysłać komentarze I sugestie na temat tego tematu do naszego zespołu dokumentacyjnego. Zespół dokumentacyjny nie może udzielać informacji na pytania natury technicznej. Proszę kliknąć tutaj, aby uzyskać informacje dotyczące pomocy technicznej.

* Wymagane

 
*Email:  
Temat:   Opinie dotyczące tematów pomocy
Strona:   Retrieving SQL Values from a Linked Server Source
*Komentarz:  
*   Oświadczam, że zapoznałem/zapoznałam się z polityką prywatności, zgodnie z którą moje dane osobowe będą wykorzystywane przez firmę Dassault Systèmes, i niniejszym ją akceptuję

Wydrukuj temat

Wybierz zakres treści do druku:

x

Wykryliśmy że używasz przeglądarki w wersji starszej niż Internet Explorer 7. Dla zoptymalizowanego wyświetlania sugerujemy uaktualnienie przeglądarki do Internet Explorer 7 lub nowszej.

 Nie pokazuj tego komunikatu ponownie
x

Wersja zawartości pomocy w sieci Web: SOLIDWORKS PDM 2014 SP05

Aby wyłączyć pomoc w sieci Web w oprogramowaniu SOLIDWORKS i użyć zamiast tego pomocy lokalnej, należy kliknąć Pomoc > Użyj pomocy SOLIDWORKS w sieci Web.

Aby zgłosić problemy związane z interfejsem lub funkcją wyszukiwania pomocy w sieci Web, należy skontaktować się z lokalnym przedstawicielem pomocy technicznej. Aby wyrazić opinie dotyczące poszczególnych tematów pomocy, należy użyć łącza “Opinie dotyczące tego tematu” na stronie danego tematu.