隱藏目錄

SQL Query Examples

These are examples of queries you can use to return list values from the Enterprise PDM database.

List All Unique Values Stored in a Specified Variable

This example lists values by replacing the variable name.

Select distinct Vv.ValueCache
 From VariableValue Vv
 Where Vv.VariableID =  (     select variableid
                    from variable
                    where Variablename like 'Project number')
       And Vv.ValueCache != ''
 order by Vv.ValueCache ASC

List All Project Folders Stored Under a Specified Folder

This example lists folders by replacing the folder path.

Select P.Name
 From Projects P, ProjectTree Pt, Projects P2
 where P.ProjectID > 1 And
            P2.Path Like '\Projects\' And
            P2.ProjectID = Pt.ProjectID And
            P.ProjectID = Pt.ChildProject
 Order By P.Name Asc

Retrieve Values from an ODBC Source

Using this method, you can get values from an ODBC source, such as an Excel spreadsheet. However, it is recommended that you use the linked server option. See Retrieving SQL Values from a Linked Server Source.

 SELECT Date 
 FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
   'Data Source="c:\Book1.xls";
     User ID=Admin;Password=;Extended properties=Excel 8.0')...Sheet1$ 
In this example:
  • The Excel file must be accessible by the SQL server (can be UNC path).
  • Date is the column name.
  • Sheet1 is the sheet name.
  • The server connection information should be to the local SQL server. For example, you can use the vault database name.


提供對此主題的意見反應

SOLIDWORKS 歡迎您提供有關於文件呈現方式、正確性、及完整性的意見反應。請使用下方的表格直接將您對此主題的意見與建議傳送給我們的文件團隊。文件團隊並無法回答關於技術支援的問題。按一下此處來獲得關於技術支援的資訊

* 必要的

 
*電子郵件:  
主旨:   說明主題的意見反應
頁面:   SQL Query Examples
*意見:  
*   我承認已閱讀且僅此接受隱私權政策,Dassault Systèmes 將遵循此政策之規定使用我的個人資料

列印主題

選擇要列印的內容範圍:

x

偵測到您使用的瀏覽器版本是舊於 Internet Explorer 7。要獲得最佳的顯示,建議您升級瀏覽器到 Internet Explorer 7 或更新的版本。

 不要再次顯示此訊息
x

Web 式說明內容版本:SOLIDWORKS PDM 2014 SP05

要從 SOLIDWORKS 中停用 Web 式的說明並改用本機說明,請按一下說明 > 使用 SOLIDWORKS Web 式說明

要報告在 Web 式說明介面及搜尋中遇到的問題,請聯絡您當地的技術支援代表。要針對個別說明主題提供意見反應,請使用個別主題頁面中的「提供對此主題的意見反應」連結。