SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


TSQL


TSQL

Author
Message
Tom Garth
Tom Garth
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1239 Visits: 1499
A valid identifier is the #


Thanks for the info Yoda... er... Sankar. Something new I learned.Smile

Tom Garth
Vertical Solutions

"There are three kinds of men. The one that learns by reading. The few who learn by observation. The rest of them have to pee on the electric fence for themselves." -- Will Rogers

StarNamer
StarNamer
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1638 Visits: 1992
james (2/9/2009)
So it adds a temp table into memory or on the permamnent media or both? How long does the temp table last?

There have been times when I want to use a temp table to hold some data for the length of a webpage, but I generally have a table called tempSomethingMeaningful and clear the table when I am done. This way I don't have to worry about setting up the columns every time.
Temporary tables last as long as the connection that created them. They may be in memory or stored in the database tempdb. See http://msdn.microsoft.com/en-us/library/aa933114(SQL.80).aspx.

Using temp tables from web pages will depend on how much control you have over the connection. I beleive that a connection is automatically closed at the end of each page rendition (haven't checked) so if you need data to persist from one page to another you need to use permanent tables. Temp tables are mainly used for intermediate results, usually for perfromance reasons; i.e. select some data to a temp table, then do further transformations on the subset of data in the temp table.

Derek
Sankar Reddy
Sankar Reddy
SSC-Addicted
SSC-Addicted (496 reputation)SSC-Addicted (496 reputation)SSC-Addicted (496 reputation)SSC-Addicted (496 reputation)SSC-Addicted (496 reputation)SSC-Addicted (496 reputation)SSC-Addicted (496 reputation)SSC-Addicted (496 reputation)

Group: General Forum Members
Points: 496 Visits: 1250
This is written as a trivia question and to raise awareness that certain questionable features will not be supported in future versions of SQL Server. Follow the link to learn about functionalities that might be going away in near future.

Features Not Supported in a Future Version of SQL Server

I do NOT recommend using this method and once again it is written to raise awareness.

Sankar Reddy | http://SankarReddy.com/
StarNamer
StarNamer
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1638 Visits: 1992
Sankar Reddy (2/10/2009)
This is written as a trivia question and to raise awareness that certain questionable features will not be supported in future versions of SQL Server. Follow the link to learn about functionalities that might be going away in near future.

Features Not Supported in a Future Version of SQL Server

I do NOT recommend using this method and once again it is written to raise awareness.
But, for now, this is legal T-SQL! Smile

declare @ int, @@ int create table
# (_ int, _@ int, _@@ int) insert
# values(1,1 - + + - -
- - + - 1, 1 - + - + - +
- - + - + - 1) select @=_,@@=_@ from
# select * into
## from
# drop table
# drop table
##



Derek
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search