Ask a Question related to Microsoft SQL / MS SQL Server, Design and Development.
-
SiWhite #1
Abstraction of table variable declaration
Hi all,
I'm trying to simplify the maintenance of my stored procedures using SQL
Server 2000's table variables.
Currently each sp returns multiple result sets (1 to 4) that were using
a large SELECT statement (with multiple table joins) to query the same
subset of data in different ways.
I've managed to abstract the creation of the data subset by using a
table valued udf and I intend to use this in the sp's to simplify the
SELECT statements. My problem is I can't work out how to abstract the
creating of the table variable itself.
Ideally I'd like to do something like:
CREATE PROCEDURE dbo.usp_TheSPName AS
DECLARE @WorkingTable TABLE (dbo.udf_CreateTable())
INSERT INTO @WorkingTable SELECT * FROM dbo.FillTable()
-- run SELECTS here...
This would mean I could maintain the structure and contents of the data
subset in two places rather than 500+!
Any ideas (I'm not dead set on using udf's either..)?
Thanks
SiWhite
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
SiWhite Guest
-
Insert ASP variable into SQL table
Hi, I have a variable called 'pSKU' (without quotes) that holds the SKU of a product. When someone visits a product page, I would like it to... -
One line variable declaration with multiple conditions
Howdy list. I'm trying to one lineify this: my $guts = $firstchoice || ''; if(!$guts && $use_second_choice_if_first_is_empty) { $guts =... -
Looking for Abstraction Plugin
I saw a plugin that took an image and textured it with a modern art lighting affect. Sort of fuzzed the shapes and added color to them. I can't... -
dbx Database abstraction layer
Martin Lucas-Smith <mvl22@cam.ac.uk> wrote in message news:<Pine.SOL.4.44.0308291546440.17650-100000@green.csi.cam.ac.uk>... According to tests... -
Global Variable declaration
For some reason this wont compile, it says that i need to declare the variable before using it on prepareMovie global sm204 -
SiWhite #2
Re: Abstraction of table variable declaration
Thanks for the advice Jacco.
My profiling would have picked up the performance hit but you've saved
me some pointless work.
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
SiWhite Guest



Reply With Quote

