Hi there,
I have finally come to the point where i can't proceed without learning how to use return parameters!
i need to return minGroupID or ProductUID ... they are the same. So somehow i need to set the variable @Returny
ideas?
............................................................
CREATE PROCEDURE [dbo].[InsertProductRecordBasedOn]
@ProdID as int,
@Returny as int OUTPUT
AS
INSERT INTO tblProductRecord
SELECT
(SELECT MIN(ProductUID) + 1 AS minGroupID
FROM tblProductRecord
WHERE ((ProductUID + 1) NOT IN
(SELECT ProductUID
FROM tblProductRecord))) as ProductUID,
ProductName + "-Copy", TypeUID, CampaignUID, PMUID, PPUID, StartDate, EndDate, ChargeUID, Objective, Measure, Confidential, Notes, Fellows, Chartered,
Technical, TechnicalTrainees, Trainees, Students, Affiliates, Retired, Members, Consumers, Business, Government, Professionals, Prospective,
Academia, Employers, Media, Completed, getdate(), getdate(), CreatorID, Deleted, DateDelivered, LifeExpect, BookID, EBMSid,
FoundID, eBriefFreq, Publically, Cancelled, NumberAtPublish
FROM tblProductRecord
WHERE (ProductUID = @ProdID)
GO
I have finally come to the point where i can't proceed without learning how to use return parameters!
i need to return minGroupID or ProductUID ... they are the same. So somehow i need to set the variable @Returny
ideas?
............................................................
CREATE PROCEDURE [dbo].[InsertProductRecordBasedOn]
@ProdID as int,
@Returny as int OUTPUT
AS
INSERT INTO tblProductRecord
SELECT
(SELECT MIN(ProductUID) + 1 AS minGroupID
FROM tblProductRecord
WHERE ((ProductUID + 1) NOT IN
(SELECT ProductUID
FROM tblProductRecord))) as ProductUID,
ProductName + "-Copy", TypeUID, CampaignUID, PMUID, PPUID, StartDate, EndDate, ChargeUID, Objective, Measure, Confidential, Notes, Fellows, Chartered,
Technical, TechnicalTrainees, Trainees, Students, Affiliates, Retired, Members, Consumers, Business, Government, Professionals, Prospective,
Academia, Employers, Media, Completed, getdate(), getdate(), CreatorID, Deleted, DateDelivered, LifeExpect, BookID, EBMSid,
FoundID, eBriefFreq, Publically, Cancelled, NumberAtPublish
FROM tblProductRecord
WHERE (ProductUID = @ProdID)
GO