General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Derek,
You can do that by modifying the stored procedure to have an output parameter.
Modify your stored procedure as follows:
CREATE Procedure ApplicationLoginInsert1 @lcParam1 char(128), @lcOutput char(10) output
AS
insert into ApplicationLogin (Login_PC) values (@lcParam1)
declare @lnLoginID int
exec @lnLoginID = Version1.dbo.ApplicationLogin.Login_ID
return (@lnLoginID)
GO
Then call it using the following syntax :
lcParam1 = 'MyPCName'
lcOutput = space(10)
=SQLExec(lnConnection, "execute ApplicationLoginInsert1 ?lcParam1,?@lcOutput")
This should return the login id. Note: In the example I assumed the id is of character data type. You can change it to what you want.
Also make sure to declare the output parameter to the proper datatype.
Regards,
Navneet
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only