Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OUTPUT - Variables
Message
From
17/02/2004 04:39:55
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Title:
OUTPUT - Variables
Miscellaneous
Thread ID:
00877862
Message ID:
00877862
Views:
35
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.
Next
Reply
Map
View

Click here to load this message in the networking platform