| SP Name | Input Parameters | Output Parameters | Functionality |
| Sp_Insurance_UsernameExists | @username nvarchar(50) | @returnValue int | Should check if the passed in username exists in the webcrendetials table. IF exists, return 1 otherwise return 0 |
| Sp_Insurance_InsertCustomer | All the columns of customer table except ID (as ID is an identity column) and also the columns of the Web Credentials table | @ID int | Should insert a row in the customer table and return the ID of the created row |
| Sp_Insurance_InsertCustomerOrder | All the columns from the order table and the ID of the customer who was inserted by the above stored proc. | @ID int | Insert the row in the order and return the order ID |
Need to set parameters in stored procedures of sql server
Hello,
I have task and i got struck with these SQL server Stored procedures. Am confused and not understanding on how to declare them and write the parameterss. Mainly the select statements for the functionality .
Please can one help me in writing these
following is the table showing stored procedures requirements
?????? ???Posted Jul 8, 2015, 7:54 PM
Abhi mePosted Jul 4, 2015, 10:37 AM
Pankaj Kumar ChoudharyPosted Jul 4, 2015, 2:09 AM
SET @EXIST = 1
ELSE
SET @EXIST = 0
Abhi mePosted Jul 4, 2015, 1:30 AM
Abhi mePosted Jul 4, 2015, 1:26 AM
Pankaj Kumar ChoudharyPosted Jul 4, 2015, 12:31 AM
CREATE PROC Sp_Insurance_InsertCustomer(@COL1 DATATYPE, @COL2 DATATYPE .............@COLn DATATYPE)
AS
BEGIN
INSERT INTO customer VALUES (@COL1,@COL2..........@COLn)
SELECT MAXI(ID) FROM customer
END
Pankaj Kumar ChoudharyPosted Jul 4, 2015, 12:00 AM
AS
BEGIN
DECLARE @EXIST INT;
SET @EXIST=( SELECT COUNT(*) from dbo.webcrendetials e where E.username = @username)
IF @EXIST> 0
SET @EXIST = 1
ELSE
SET @EXIST = 0
SELECT @EXIST;
END
Dorababu MekaPosted Jul 3, 2015, 11:09 PM