Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OUTPUT - Variables
Message
De
17/02/2004 04:39:55
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Titre:
OUTPUT - Variables
Divers
Thread ID:
00877862
Message ID:
00877862
Vues:
36
Hi all!

Can anyone please tell me what's wrong with this SP?
CREATE PROCEDURE NewAlbbild 
	@firma VARCHAR(200),
	@sprachid INT,
	@beschreibung VARCHAR(200),
  	@actid INT OUTPUT
AS INSERT INTO albbild (firma,sprachid,beschreibung) 
VALUES (@firma,@sprachid,@beschreibung)

SELECT @actid = @@IDENTITY FROM albbild
GO
In VB.NET I create the command the following way:
...
oSelect=NEW SqlClient.SqlCommand("NewAlbbild",oConnect)
oSelect.CommandType=CommandType.StoredProcedure
With oSelect.Parameters
     .Add("@firma","TEST")
     .Add("@sprachid",1)
     .Add("@beschreibung","HALLO")
     .Add("@actid",0)
Endwith
oSelect.Parameters("@actid").Direction=ParameterDirection.Output
oSelect.ExecuteNonQuery()
nActId=oSelect.Parameters("@actid").Value
I get an error when executing the command stated above - either '...Parameter "@actid" is missing...' or '...an error occured...'.
I'm using SQL-Server 7.

Thanks for any help
robert.oh.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform