I am using VB as a front-end. I would like to call a stored procedure by passing a parameter with multiple value. I having difficulties creating the stored procedure. The use of Having is because I could have multiple values seletected by the user.
CREATE PROCEDURE dbo.procLoadDocumentationRecords
@lngEquipID int
AS
SET NOCOUNT ON
SELECT dbo.tblEquipment.EquipmentNo, dbo.tblEquipment.Description, dbo.tblEquipment.EquipID, dbo.tblDocumentation.DocumentationID,
dbo.tblDocumentation.HECPID, dbo.tblDocumentation.EquipmentNoFk, dbo.tblDocumentation.PrDevelopedBy, dbo.tblDocumentation.PrApprovedBy,
dbo.tblDocumentation.DateApproved, dbo.tblUserGroups.UserFullName
FROM dbo.tblDocumentation LEFT OUTER JOIN
dbo.tblEquipment ON dbo.tblDocumentation.EquipmentNoFk = dbo.tblEquipment.EquipID LEFT OUTER JOIN
dbo.tblUserGroups ON dbo.tblDocumentation.PrApprovedBy = dbo.tblUserGroups.UserGroupsID
GROUP BY dbo.tblEquipment.EquipmentNo, dbo.tblEquipment.Description, dbo.tblEquipment.EquipID, dbo.tblDocumentation.DocumentationID,
dbo.tblDocumentation.HECPID, dbo.tblDocumentation.EquipmentNoFk, dbo.tblDocumentation.PrDevelopedBy, dbo.tblDocumentation.PrApprovedBy,
dbo.tblDocumentation.DateApproved, dbo.tblUserGroups.UserFullName
SET NOCOCOUNT OFF
How do I create the stored procedure and how do I call it from VB?
Any Help will be greatly appreciated
Thank you
CREATE PROCEDURE dbo.procLoadDocumentationRecords
@lngEquipID int
AS
SET NOCOUNT ON
SELECT dbo.tblEquipment.EquipmentNo, dbo.tblEquipment.Description, dbo.tblEquipment.EquipID, dbo.tblDocumentation.DocumentationID,
dbo.tblDocumentation.HECPID, dbo.tblDocumentation.EquipmentNoFk, dbo.tblDocumentation.PrDevelopedBy, dbo.tblDocumentation.PrApprovedBy,
dbo.tblDocumentation.DateApproved, dbo.tblUserGroups.UserFullName
FROM dbo.tblDocumentation LEFT OUTER JOIN
dbo.tblEquipment ON dbo.tblDocumentation.EquipmentNoFk = dbo.tblEquipment.EquipID LEFT OUTER JOIN
dbo.tblUserGroups ON dbo.tblDocumentation.PrApprovedBy = dbo.tblUserGroups.UserGroupsID
GROUP BY dbo.tblEquipment.EquipmentNo, dbo.tblEquipment.Description, dbo.tblEquipment.EquipID, dbo.tblDocumentation.DocumentationID,
dbo.tblDocumentation.HECPID, dbo.tblDocumentation.EquipmentNoFk, dbo.tblDocumentation.PrDevelopedBy, dbo.tblDocumentation.PrApprovedBy,
dbo.tblDocumentation.DateApproved, dbo.tblUserGroups.UserFullName
SET NOCOCOUNT OFF
How do I create the stored procedure and how do I call it from VB?
Any Help will be greatly appreciated
Thank you