| Author |
Topic  |
|
X002548
Not Just a Number
15586 Posts |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
USA
6997 Posts |
|
|
SwePeso
Patron Saint of Lost Yaks
Sweden
29138 Posts |
Posted - 10/16/2006 : 14:29:27
|
To quotequote: He is a Rain Man, without the math skill
Peter Larsson Helsingborg, Sweden |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
USA
6997 Posts |
Posted - 10/16/2006 : 14:48:09
|
quote: Originally posted by Peso
To quotequote: He is a Rain Man, without the math skill
Peter Larsson Helsingborg, Sweden
I'm a good DBA, I'm a good DBA...
CODO ERGO SUM |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 10/16/2006 : 14:49:58
|
quote: Originally posted by Michael Valentine Jones
quote: Originally posted by Peso
To quotequote: He is a Rain Man, without the math skill
Peter Larsson Helsingborg, Sweden
I'm a good DBA, I'm a good DBA...
CODO ERGO SUM
Make sure you click your ruby slippers 3 times
Brett
8-)
Hint: Want your questions answered fast? Follow the direction in this link http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Add yourself! http://www.frappr.com/sqlteam
|
 |
|
|
SwePeso
Patron Saint of Lost Yaks
Sweden
29138 Posts |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
DonAtWork
Flowing Fount of Yak Knowledge
2111 Posts |
|
|
qailoh
Starting Member
4 Posts |
Posted - 10/18/2006 : 11:50:30
|
I joined this forum just so I could follow this fascinating saga... |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
USA
6997 Posts |
|
|
SwePeso
Patron Saint of Lost Yaks
Sweden
29138 Posts |
Posted - 10/19/2006 : 02:22:38
|
quote: Originally posted by Michael Valentine Jones
He reminds me of that movie Groundhog Day where he lives the same day over and over. It’s like he wakes up and starts the same thread again every day.
Thank you, Michael! This is a very memorable post. Now my week (and next) is saved. When it is getting boring, I just look up this reply again 
Peter Larsson Helsingborg, Sweden |
Edited by - SwePeso on 10/19/2006 02:23:33 |
 |
|
|
DonAtWork
Flowing Fount of Yak Knowledge
2111 Posts |
|
|
SwePeso
Patron Saint of Lost Yaks
Sweden
29138 Posts |
Posted - 10/19/2006 : 07:30:45
|
Actually I wrote "Are you insane?"  In this answer http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=73540#263630
He really got to my nerves, but after that I realized that the problem itselt was interesting. At the end, I got a optimized solution http://www.sqlteam.com/forums/topic.asp?whichpage=2&TOPIC_ID=73610#264068 that is fast and works every time. But there is only one problem with the code. I can't select from the table #GiveAway! I hade to use double # as ##. Can anyone explain why?
But I was upset with his manner to occupy resources on several forums and he didn't listen to any of us.
Peter Larsson Helsingborg, Sweden |
Edited by - SwePeso on 10/19/2006 07:39:22 |
 |
|
|
spirit1
Cybernetic Yak Master
Slovenia
11741 Posts |
|
|
spirit1
Cybernetic Yak Master
Slovenia
11741 Posts |
Posted - 10/19/2006 : 08:29:10
|
you constructed your #temp table with dynamic sql and it got created in the scope of the EXEC() statment. once exec() finished the #temp table was dropped. ##Global temp tables are however perserved.
Go with the flow & have fun! Else fight the flow  blog thingie: http://weblogs.sqlteam.com/mladenp |
Edited by - spirit1 on 10/19/2006 08:29:43 |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
USA
6997 Posts |
Posted - 10/19/2006 : 12:17:24
|
quote: Originally posted by spirit1
you constructed your #temp table with dynamic sql and it got created in the scope of the EXEC() statment. once exec() finished the #temp table was dropped. ##Global temp tables are however perserved.
Go with the flow & have fun! Else fight the flow  blog thingie: http://weblogs.sqlteam.com/mladenp
I really try to avoid ##temp tables, but in some cases it is hard to do. For example, when you want to BCP the table out.
I use a NEWID() to create the table name to avoid the possibility of a collision if two people are running the same procedure at the same time. It can be really hard to track that down if it is happening. We specifically check for ## table before moving procedures into production, and only allow it if it is really needed, and the name is generated dynamically with a NEWID()
declare @temp_table_name sysname
set @temp_table_name = '##temp_'+replace(newid(),'-','')
exec ('create table '+@temp_table_name+' ( MyCol int not null )')
exec ('insert into '+@temp_table_name+' select 1' )
exec ('select * from '+@temp_table_name )
exec ('drop table '+@temp_table_name )
CODO ERGO SUM |
 |
|
|
spirit1
Cybernetic Yak Master
Slovenia
11741 Posts |
|
|
mcrowley
Aged Yak Warrior
771 Posts |
Posted - 10/19/2006 : 13:10:06
|
| You realize that if you don't help him pass this class, he will just have to take it all over again next semester...OK, imagining he can be helped was a bit of wishful thinking. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
Topic  |
|