Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Yet another SQL Question
Message
From
29/09/2012 17:27:25
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Miscellaneous
Thread ID:
01553897
Message ID:
01553952
Views:
59
Thanks, Sergey. Don't know how I missed that. If I am running in debug for testing, as I do with my big SPs, and and have created the # table this way, do I still need to explicitly drop it when it has been created by a previous run and the code is running in SSMS rather than as an SP? That is does it behave like a @ table variable or is it actually aliased on the server?

>There's no difference how you create temp table and you can add more columns to select
>
>>Hmmm, googled a bit and it seems you can in fact do this,and the 1=0 would give you a blank one.
>>
>>Doesn't log. Somehow missed that trick as I always create the # tables manually. Is there a downside besides the logging for rollback and can the result then be treated like any # table that is created with an explicit statement as below? And can one also add defined columns not int he original table in the select statement ( cast(0 as bit) foo ) ?
>>
>>
>>


Charles Hankey

Though a good deal is too strange to be believed, nothing is too strange to have happened.
- Thomas Hardy

Half the harm that is done in this world is due to people who want to feel important. They don't mean to do harm-- but the harm does not interest them. Or they do not see it, or they justify it because they are absorbed in the endless struggle to think well of themselves.

-- T. S. Eliot
Democracy is two wolves and a sheep voting on what to have for lunch.
Liberty is a well-armed sheep contesting the vote.
- Ben Franklin

Pardon him, Theodotus. He is a barbarian, and thinks that the customs of his tribe and island are the laws of nature.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform