Insert into Table_variable - UDF vs. SP behavior?
From: Wael Fadel (wael_fadel_at_hotmail.com)
Date: 07/01/04
- Next message: IseriesBuff: "MSDE Installation error message"
- Previous message: George Hester: "Re: I wonder if these ADO constants really work at all"
- Next in thread: Steve Kass: "Re: Insert into Table_variable - UDF vs. SP behavior?"
- Reply: Steve Kass: "Re: Insert into Table_variable - UDF vs. SP behavior?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 1 Jul 2004 16:15:24 -0700
Hello,
I am wondering if MS is planning to change the behavior of UDFs vs. SP when
it comes to inserting into table variables?
A colleague and I were working on changing temp table inserts into
table_variable inserts when we hit came across the documented:
table variables may not be used in the following statements:
INSERT INTO table_variable EXEC stored_procedure
SELECT select_list INTO table_variable statements
We were able to bypass that by creating a UDF and then use this syntax
Insert into Table_Variable select * from dbo.UDF
Why don't the previous statements work? What is the scope of the table
variable right after creation? If this is by design what is the benefit
gained by it?
I ask because to my mind it is more efficient when inserting from an SP vs.
UDF.
Thanks,
Wael (Will) Fadel
DBA
- Next message: IseriesBuff: "MSDE Installation error message"
- Previous message: George Hester: "Re: I wonder if these ADO constants really work at all"
- Next in thread: Steve Kass: "Re: Insert into Table_variable - UDF vs. SP behavior?"
- Reply: Steve Kass: "Re: Insert into Table_variable - UDF vs. SP behavior?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|