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 cphite on 09/07/06 19:54

--CELKO-- wrote:
> >> There are a lot of reasons someone might want to create a table on the fly. They might want to store a snapshot of data at a given time that is easily accessable. <<
>
> >> It may not fit your ideal of how SQL "should" be used, but it's actually quite common in the real world - and it need not invoke images of falling pachyderms. <<
>
> Good RDBMS programming and principles are not my personal opinion; you
> can read Dr. Codd, Chris Date, Fabian Pascal, McGovern, etc. for the
> foundations. Erland just told the guy the same thing, but without any
> details to help him learn. Why not jump him and rant?

I've read from all of those guys - but the fact of the matter is, at
the end of the day business needs what business needs. There is
nothing wrong with creating a temp table if you need to create a temp
table.

> >> Sometimes it's just convenient to make a temp table. <<
>
> Yes, it is. It is also just convenient to use a copper penny instead
> of getting a fuse from the hardware store.

The difference is that a putting a penny in your fuse box can burn your
house down; whereas creating a temp table will not. You might run into
problems down the road if you're misusing temp tables, but that is a
different issue altogether.

> >> He told you what he wanted - the "problem" is your inability to understand that most people use SQL in ways that go beyond your precious standard. <<
>
> No, there was no problem statement.

He asked how to create a dynamically named table.

> As Chris Date puts it in a book
> title of his, we need to hear "WHAT" and not "HOW" to have a spec.

And if we were getting specs for a project that would be a valid point
- we're not, so it isn't. He asked a simple question about how to do
something the language clearly supports doing.

> Also, I think that after seven books on the language and ten years on
> the Standards Committee, I have some understanding of SQL :)

Maybe, maybe not - I've read a lot of pretty bad technical books :b

> What are your credentials?

I stayed at a Holiday Inn Express.

> A problem statement is "my bill of materials is a hierachy and I need
> to aggregate the weights of the components into the sub-assemblies"; it
> is not "How do I create a temp table {assumed method} to aggregate
> the weights of the components into the sub-assemblies"; that is a
> method and not a result.

His problem is that he wanted to make a table with a dynamic name and
didn't know how. YOUR problem is that you're an arrogant,
self-important ass who uses usenet to bash people from behind your
keyboard.

> Now we can come back with the nested sets
> model, or adjacency list model with a recursive CTE as a suggestion for
> the hierarchy, and avoid a temp table completely.

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.

> Ask "WHAT" and not
> "HOW" -- basic software engineering. Hell, basic any kind of
> engineering!

Maybe if you have time you might look into basic human interaction.

 

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

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