I'm trying to do a practice question for my SQL class and I'm having lots of trouble getting my query to work properly, here's my code - can anyone help me?
- Write a stored procedure called LookUpCustomer that accepts any part of a Customers last name.
Return all the customer attributes for those customers from the customer table.
Code:
Create Procedure LookUpCustomer
(@CustomerLastName varchar(30) = null)
as
select CustomerLastName
from Customer
where @CustomerLastName like ('_[A-Z]_')
I'm getting these results:
CustomerLastName:
Simpson,
Jones,
Forman,
smilie,
Lauper,
Marley,
Presely,
Clapton,
Johnson,
Douglas,
Leno,
Little,
Tyler,
McDonald,
Carlson,
but I need it so it takes any part of a customer last name, I don't know if this is working properly, thanks to all that help out!