Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SPT and STORED PROC. ON sql 7
Message
De
21/10/2002 15:55:22
 
 
À
21/10/2002 12:55:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00713409
Message ID:
00713641
Vues:
16
Maybe you should try a different approace

CREATE PROCEDURE validate
@field nvarchar(7)
,@exists char(1) OUTPUT
AS
IF EXISTS (SELECT * FROM table WHERE x=@field)
@exists = 'Y'
ELSE
@exists = 'N'


-Mike

>Hi everybody,
>
>I am stil working on this strange behiavour in comm betwen SQL2,2000 and
>VFP 7. Problem must be in select statement in Stored procedure. If RowCount is 0, strange message "Comunication error ocure". If I change logic and raiserror after select which return one or more record VFP receive raised error?
>
>Example
>
>
>* (field) in Table exist
>
>CREATE PROCEDURE up_Check @field nvarchar(7)
>AS
>
>Select * from dbo.Table where X = @field
>
>PRINT "Error"
>Raiserror ("",16,1)
>RETURN
>
>* This works fine. VFP will get message "ERROR"
>
>
>* in thi example (field) does no exist
>CREATE PROCEDURE up_Check @field nvarchar(7)
>AS
>
>Select * from dbo.Table where X = @field
>
>IF @@RowCount = 0
>BEGIN
> PRINT "Error"
> Raiserror ("",16,1)
>END
>* This will return to VFP error "Conectivity error..."
>
>Problem is when SELECT returns 0 rows. IN Query analyzer message OK in VFP not ?
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform