
How to create temp table?
Quote:
> Using VB6.0 and SQL server 6.0, how do I create a temporary table?
There are 2 ways:
1. Create Table #<Table Name> ... The # does the trick here. Look
into what ##<Table Name> can do.
2. SELECT ... INTO <Table Name> FROM ... This requires that the Temp
Table/Batch Data Transfer upload option be set on the server (forget
the actual option name.) That means the Transaction log is regularly
shot to hell. You can't use this in a production application.
In a previous life I worked on a Retail Banking automation product using
Sybase SQL Server (MS SQL Server base source comes from Sybase.) We used to
create required temp tables at design time and permanently leave them them
there. When a program needed it
, it would
- DELETE FROM <Table> (no where condition)
- Use the table and hopefully clean up afterwards
That's faster, no table-creation overhead for the program. You can
scrupulously follow the data-types, rules and other project standards for
tables and columns as the table is created at design time. When you create
them in code, there's this temptation t
o use a and tmp_cod as column names.
--
MikeC
Please reply to the group.