Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
I have forgotten how to pass Params using SQLEXEC()
Message
De
27/01/2004 12:19:03
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
I have forgotten how to pass Params using SQLEXEC()
Divers
Thread ID:
00871025
Message ID:
00871025
Vues:
46
Its late and I have forgotten how to pass params to SQL Server SP from VFP
Everything I try returns -1

My connection is fine

I have tried variations on the following

tn=SQLCONNECT('dataprot')
? SQLEXEC(tn, 'exec #sp_udepartment 0,"test"')

v1=0
v2="test"

? SQLEXEC(tn, 'exec #sp_udepartment v1,v2')

and also

? SQLEXEC(tn, 'exec #sp_udepartment @v1,@v2')



Here is the SP I am trying to call. There is a chance I have the SP wrong since I am still a novice with SQL Server.
CREATE PROCEDURE sp_uDepartment 
	@deptid int,
	 @deptname varchar(10)
AS
	SET NOCOUNT ON

	SET XACT_ABORT ON

	BEGIN TRANSACTION
	IF (@deptid = 0 OR @deptid IS NULL)
	BEGIN
		-- Insert Values into the Department table
		INSERT Department
			(deptname)

		SELECT @deptname

		SELECT @deptid = SCOPE_IDENTITY()

	END
	ELSE
	BEGIN
		-- Update the Department table
		UPDATE Department
		SET deptname = ISNULL(@deptname, deptname)
		WHERE deptid = @deptid
	END



GO
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform