You are here: Re: Creating a dynamic Global Temp Table within a stored procedure « MsSQL Server « IT news, forums, messages
Re: Creating a dynamic Global Temp Table within a stored procedure

Posted by Ed Murphy on 09/08/06 02:03

cphite@gmail.com wrote:

> Or, we could realize that he's probably working on something right now
> and needs an answer to his rather simple question. We could point out
> to him that there are more standard ways of doing what he's doing, and
> if he cares we could point him towards those ways.

The time to tell the newbie "don't do that" is /now/ - not two years
later, after the bad method has spent two years getting itself
entrenched in the system.

Original Poster, if you're still reading this thread: it would almost
certainly be better to use a table with a static name, moving the
dynamic portion to a column within that table, e.g.

-- ##TICKETS has structure (TICKET VARCHAR(20), DATA XML)

INSERT INTO ##TICKETS (TICKET, DATA) VALUES (@TICKET, @DATA)

I'm not familiar with global temp tables (I've learned a little by
Googling today) so I'll let someone else address their pros/cons.

Speaking of Googling, this seems particularly relevant:

http://www.sommarskog.se/dynamic_sql.html#Cre_tbl

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация