Sakura Sim

Sakura Sim

  • NA
  • 1
  • 891

C# Store Procedure

Mar 3 2015 8:04 AM
SET ANSI_NULLS ON;
GO
SET QUOTED_IDENTIFIER ON;
GO
----1----+----2----+----3----+----4----+----5----+----6----+----7----+----
-- Name : usp_AttributeValueList_Select
--
-- Parameters :
-- Modification log:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----
CREATE Procedure [dbo].[usp_AttributeValueList_Select]
@iAttributeDefSeqNum_IN INT = 0
, @vcAttributeDefName_IN VARCHAR ( 512 ) = ''
AS
-----------------------------
-- Getting Attribute Value
-----------------------------
IF @iAttributeDefSeqNum_IN > 0
BEGIN
SELECT
AD.[Name]
, AD.AttributeDefSeqNum
, AV.[Value]
, AV.AttributeValueSeqNum
, AV.Description
FROM
AttributeDef AD
INNER JOIN AttributeValue AV ON AV.AttributeDefSeqNum = AD.AttributeDefSeqNum
WHERE
AD.AttributeDefSeqNum = @iAttributeDefSeqNum_IN
AND AV.IsDisabled = 0
ORDER BY
AV.OrderIndex, AV.[Value]
END
IF LEN(@vcAttributeDefName_IN) > 0
BEGIN
SELECT
AD.[Name]
, AD.AttributeDefSeqNum
, AV.[Value]
, AV.AttributeValueSeqNum
, AV.Description
FROM
AttributeDef AD
INNER JOIN AttributeValue AV ON AV.AttributeDefSeqNum = AD.AttributeDefSeqNum
WHERE
AD.[Name] = @vcAttributeDefName_IN
AND AV.IsDisabled = 0
ORDER BY
AV.OrderIndex, AV.[Value]
END
Hi Gurus,
 
I am newbie to c# + Store Procedure. Please help me to understand. Above is a store procedure. May I ask why it do not point to a table? Thank you.

Answers (2)