I know I can do this:
SELECT FirstName, LastName INTO #Names FROM CustNames
and I know I can do this:
INSERT INTO #Names EXEC dbo.MyProc '02/05/2009', 0
(where #Names has been previously defined)
But can I do this?
SELECT FirstName, LastName INTO #Names EXEC dbo.MyProc '02/05/2009', 0
I want to select the return values of a procedure into a new table that I
haven't previously defined.
Thanks,
Keith
It might have something to do with the fact that stored procedures are
not deterministic. The returned data structure is not known until the SP
is called. In fact, it might depend on some logic within the SP.
--
Gert-Jan
SQL Server MVP
The MOST BASIC assumption of RDBMS is that you know the nature of the
"Universe of Discourse" when you are in SQL. A table is a set of
things of the same kind or a relationship. Everything is defined.
Creating a new table on the fly is like making dinosaurs appear out of
thin air in the middle of a romantic comedy.
It is more than just getting a feature in one product wrong, like
Strik told you; you are getting foundations wrong and writing crappy
code.
"--CELKO--" <jcel...@earthlink.net> wrote in message
news:a976aed6-70cb-4fef...@p35g2000yqh.googlegroups.com...
"Gert-Jan Strik" <sorrytoomuc...@xs4all.nl> wrote in message
news:4B05BF85...@xs4all.nl...