Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create Temp Table in Sql Server
Message
De
14/11/2014 11:55:49
 
 
À
12/11/2014 18:36:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01610894
Message ID:
01610999
Vues:
45
Thank you Walter for the answer, Sergey for the KITN, and everybody else for your assistance.

Apparantly, my testing wasn't as inclusive as it should have been - I focused on the data type more than the usage of parameters.

If I understand correctly..........

Using a ? parameter in the query causes SQL Server to execute a stored procedure. The SP runs in the equivalent of its
own instance and, because I specified only #, the result set disappears when the SP ends. When I specify ##, the result
set is visible to my VFP ODBC connection (and, I think, any other open instance of SQL Server) and disappears when
all the instances that reference it are disconnected.

Without using a ? parameter, the result set is created and, when # is used, it is visible only to the instance which created it.
If ## is used, the same rules about open instances apply.

Do I have this essentially correct?

The implication is that I need to be careful about the temp table names when using ## because other users running the same
code could create conflicts (Table Exists errors or overwriting the table or something like that) so I need to use SYS(2015)
or some equivalent to create the temp table names.

So far so good??????

Any other tips (other than to really learn how to use the Profiler - thanks Walter) greatly appreciated.

............Rich
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform