Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
I don't understand.
Message
De
14/08/2003 05:35:37
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
14/08/2003 05:15:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00819794
Message ID:
00820049
Vues:
29
>Sorry Cetin, bad writing.
>
>I send this on SQL Query Analyzer ( and on VFP SPT ).
>
>
>USE pubs
>
>exec sp_executesql N'USE master; SELECT @P1   ; SELECT DB_NAME()'
>, N'@P1 INT',  1
>
>SELECT DB_NAME()
>
>
>result:
>
>1
>
>master
>
>pubs
>
>
>It is correct, the USE database within sp_executesql is valid only
>within sp_executesql.
>
>From the first moment, it would seem that the same commando, constructed from VFP in order to replace the ?parameter,
>renders effective commando USE ( executed within sp_executesql ) in the connection , but I do not find one explanation.
>
>Fabio

Fabio,
Correcting this way I still get the expected results (same as in query analyzer - 1,master,pubs). Here is the code in VFP I tried :
lcTry = ;
"USE pubs;"+;
"exec sp_executesql N'USE master; SELECT @P1   ; SELECT DB_NAME()', N'@P1 INT',  1;"+;
"SELECT DB_NAME()"

local lnHandle
lnHandle=SQLStringConnect('DRIVER=SQL Server;SERVER=cetin\cetin;Trusted_connection=Yes')
SQLEXEC(lnHandle, lcTry)
SQLDisconnect(lnHandle)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform