Stored Procedure Parameters Not Available After Declared

Posted by SidC on Stack Overflow See other posts from Stack Overflow or by SidC
Published on 2010-05-09T04:39:48Z Indexed on 2010/05/09 4:48 UTC
Read the original article Hit count: 237

Hi All,

Pasted below is a stored procedure written in SQL Server 2005. My intent is to call this sproc from my ASP.NEt web application through the use of a wizard control. I am new to SQL Server and especially to stored procedures. I'm unsure why my parameters are not available to the web application and not visible in SSMS treeview as a parameter under my sproc name. Can you help me correct the sproc below so that the parameters are correctly instantiated and available for use in my web application?

Thanks, Sid

Stored Procedure syntax:

USE [Diel_inventory]
GO
/****** Object:  StoredProcedure [dbo].[AddQuote]    Script Date: 05/09/2010 00:31:10 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[AddQuote] as
Declare @CustID int,
@CompanyName nvarchar(50),
@Address nvarchar(50),
@City nvarchar(50),
@State nvarchar(2),
@ZipCode nvarchar(5),
@Phone nvarchar(12),
@FAX nvarchar(12),
@Email nvarchar(50),
@ContactName nvarchar(50),
@QuoteID int,
@QuoteDate datetime,
@NeedbyDate datetime,
@QuoteAmt decimal,
@ID int,
@QuoteDetailPartID int,
@PartNumber float,
@Quantity int

begin

Insert into dbo.Customers
(CompanyName, Address, City, State, ZipCode, OfficePhone, OfficeFAX, Email, PrimaryContactName)
Values (@CompanyName, @Address, @City, @State, @ZipCode, @Phone, @FAX, @Email, @ContactName)

set @CustID = scope_identity()


Insert into dbo.Quotes 
(fkCustomerID,NeedbyDate,QuoteAmt)
Values(@CustID,@NeedbyDate,@QuoteAmt)

set @QuoteID = scope_identity() 


Insert into dbo.QuoteDetail
(ID) values(@ID)

set @ID=scope_identity()



Insert into dbo.QuoteDetailParts
(QuoteDetailPartID, QuoteDetailID, PartNumber, Quantity)
values (@ID, @QuoteDetailPartID, @PartNumber, @Quantity) 
END

© Stack Overflow or respective owner

Related posts about sql-server-2005

Related posts about stored-procedures