Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to create SQL temporary table using parameterised SP
Message
From
29/01/2004 02:20:56
James Chan
Objectmastery Pty Ltd
Hawthorn, Australia
 
 
To
28/01/2004 08:22:31
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00871235
Message ID:
00871683
Views:
15
Thanks to all who provide the helpful tips.

Sergey gave me a good insight as why #TempCustNew is not available if created by parameterised SPT. This means I will have to use another approach, as suggested by Kenneth's first alternative, although I prefer parameterised SPT due to the advantages suggested by Chuck Urwiler in his book "Client-Server Applications w/h Visual FoxPro and SQL Serve".

What I actually want is to have a function that creates a medium size temporary table (~10K records) from a large table (~5M records). Then have other functions that read from this temporary table, before returning the results back to client. I do not want to return this temporary table to client because it is still a fairly big table. The temporary table is there mainly for speed purpose. I wonder if this is the right approach, or there are better ways doing it. Someone suggested using parameterised SQL-View but my understanding is that everytime when I access the SQL-View I am actually running the underlying query that creates the view. So speed is still the problem, isn't it?

I am fairly new to SQLServer. Someone told I should keep Stored Procedures to a minimum and never write Business Rules in Stored Procedures. Reasons being it is (a) Database dependant (code will not be portable if for example we change from SQLServer to Orcale); (b) The logic of the business rules not centralised; (c) a lot more troubles to release to clients. What do you all think?

Thanks
James
James Chan
ObjectMastery Pty Ltd
Previous
Reply
Map
View

Click here to load this message in the networking platform