ACC2000: How to Create and Use Temporary Tables with Access Client ServerID: Q232379
|
You can create temporary tables in both SQL Server and the Microsoft Data Engine (MSDE) using Access Client/Server. Even though you cannot see the tables in the Table pane of the Database window, temporary tables are available for use through stored procedures and other means.
When you create a temporary table in a database hosted by the MSDE or SQL Server, it is stored in the tempdb database. An Access project will connect to only one back-end database at a time (generally, a user database).
Because temporary tables and user tables are stored in different databases, Access Client/Server will not display both. Temporary tables are accessible from a user database through stored procedures and triggers, however.
The example below demonstrates the following:
CREATE PROCEDURE CreateATable
AS
CREATE TABLE ##ThisIsATest
(
MyPK int IDENTITY (1,1),
MyChar char(10)
)
CREATE PROCEDURE InsertSelect
AS
SET NOCOUNT ON
INSERT ##ThisIsATest Values('1stRecord')
INSERT ##ThisIsATest Values('2ndRecord')
SELECT * FROM ##ThisIsATest
For more information about temporary objects, refer to SQL Server 7.0 Books Online available for download from the following Microsoft Web site:
http://support.microsoft.com/download/support/mslfiles/sqlbol.exe
Additional query words:
Keywords : kbdta AccessCS
Version : WINDOWS:2000
Platform : WINDOWS
Issue type :
Last Reviewed: June 10, 1999