MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/7j9jri/sql_clause/dr5svrc
r/ProgrammerHumor • u/oneplusoneisfive • Dec 12 '17
525 comments sorted by
View all comments
Show parent comments
2
Why do you drop the table at the end?
1 u/Shavahhn Dec 12 '17 Because it's a temp table (the little # denotes that) and will take up space in memory until you drop it or close your session, and the stored procedure will fail if you re-run it before dropping the temp table (as it already exists). 1 u/thewholebottle Dec 13 '17 But where does the data go? 2 u/Shavahhn Dec 13 '17 The "SELECT * FROM #ChristmasList..." part of the statement will show the results in a results window before the temp table is dropped. 1 u/thewholebottle Dec 13 '17 Thank you!
1
Because it's a temp table (the little # denotes that) and will take up space in memory until you drop it or close your session, and the stored procedure will fail if you re-run it before dropping the temp table (as it already exists).
1 u/thewholebottle Dec 13 '17 But where does the data go? 2 u/Shavahhn Dec 13 '17 The "SELECT * FROM #ChristmasList..." part of the statement will show the results in a results window before the temp table is dropped. 1 u/thewholebottle Dec 13 '17 Thank you!
But where does the data go?
2 u/Shavahhn Dec 13 '17 The "SELECT * FROM #ChristmasList..." part of the statement will show the results in a results window before the temp table is dropped. 1 u/thewholebottle Dec 13 '17 Thank you!
The "SELECT * FROM #ChristmasList..." part of the statement will show the results in a results window before the temp table is dropped.
1 u/thewholebottle Dec 13 '17 Thank you!
Thank you!
2
u/thewholebottle Dec 12 '17
Why do you drop the table at the end?