2010-02-09 116 views
0

我正在使用Adaptive Server Anywhere 9與Sybase Central一起工作,我想了解如何使用tempDB的一些示例。如何插入臨時表?

如何插入一些記錄到臨時表中?

我想:

select * into TempDB.dba.#testing from testTable 

但我得到了以下錯誤:

Syntax error near '.' on line 1

+0

爲什麼會出現一個 「#」?也應該是tempdb – ghostdog74 2010-02-09 13:47:45

+0

我把它改成select * into tempdb.dba.testing from afdeling 但仍然是相同的錯誤 – Sjemmie 2010-02-09 14:03:32

回答

1

有兩套臨時表和你已經把它們混合起來

1)相關的還有會議訪問爲#table即

select * into #testing from testTable 

只要您的連接可以持續這個時間

2)tempdb中的表。這些一直持續到服務器重新啓動。

select * into TempDB.testing from testTable 

詳情參見SYBASE文檔ASE

+0

從testTable中選擇*到TempDB.testing中! :)但表測試並不exsist它說。我認爲它會自動創建它。 – Sjemmie 2010-02-09 14:06:29

+0

它應該這樣做 - 你試過的完整代碼是什麼 – Mark 2010-02-09 14:38:13

+0

我想我犯了一個錯字嘗試TempDB ..測試 – Mark 2010-02-09 14:39:06