In: Computer Science
) Write queries for the following. Include screenshots of the queries and the outputs.
First I created a DB named sql_store.
In that I created a table named Customer.
I used schema for Customer table is as below :
Inserted data in Customer table is as below :
Now, PROCEDURE DisplayInfo which takes customer name as parameter and displays it's information is as below:
CREATE PROCEDURE DisplayInfo @name varchar(25)
AS
SELECT * FROM Customer WHERE CustomerName = @name
When we run EXEC query as
EXEC DisplayInfo @name = 'ABC';
It will give output as below :
NOTE : I used SSMS to run this procedure.