English 中文(简体)
How to insert into a temporary table?
原标题:

I m working with Sybase Central using Adaptive Server Anywhere 9 and I want some examples of how to use tempDB.

How can I insert some records in to a temporary table?

I tried:

select * into TempDB.dba.#testing from testTable

But I got the following error:

Syntax error near . on line 1

最佳回答

There are two sets of temp tables and you have mixed them up

1) Session related there are access as #table ie

select * into #testing from testTable

This lasts as long as your connection

2) tables in tempdb. These persist until the server gets rebooted.

select * into TempDB.testing from testTable

See sybase docs for more info ASE

问题回答

暂无回答




相关问题
Configuration for ASPState database

Persistent ASP Session store can reside in either "tempdb" or "aspstate" database in SQL Server 2005. The sqlConnectionString parameter, in sessionState doesn t specify this (example below). How is ...

SQL Server 2005 TempDB Size

We are using SQL Server 2005. Recently SQL server 2005 crashed in our production environment due to large tempdb size. 1) what could be reason for large tempdb size? 2) Is there any way to look what ...

Why isn t SQL Server 2008 R2 using all available RAM?

We have an analytics database server running SQL 2008 R2 with 192 GB of physical RAM. However, we re noticing that during analytics process, the server only uses around 70 GB, but tempdb swells to 300+...

How to insert into a temporary table?

I m working with Sybase Central using Adaptive Server Anywhere 9 and I want some examples of how to use tempDB. How can I insert some records in to a temporary table? I tried: select * into TempDB....

SQL Server: Recovery model effect on TempDB

Does the recovery model of a database effect the size of the tempdb.mdf? We have a database which involves a lot of processing and bulk inserts. We are having problems with the tempdb file growing to ...

tempdb SQL Server locking

Our application runs alongside another application on a customers machine. We have put some efforts regarding avoiding long-running locks in tempdb since this obviously affects concurrency badly. The ...

Large query increases TempDB

I have huge query on my SQL 2005 Server. This have to be run once everyday but when this query runs temp db grows from 2GB to 48GB. What is the best way top optimize or find the reason why tempdb is ...

热门标签