I have the following SP I am trying to create...
create Proc procDirectoryFilter
(
@Filter nvarchar(1)
)
AS
(
SELECT *
FROM Users
WHERE SUBSTRING(LOWER(LName), 1, 1)=@Filter
ORDER BY LName
)
Everytime I try to compile it in Query Analyzer, it gives me the following error: "Incorrect syntax near the keyword ORDER". If I run the query by itself, it runs with no errors.
Any ideas?
Thanks in advance.
create Proc procDirectoryFilter
(
@Filter nvarchar(1)
)
AS
(
SELECT *
FROM Users
WHERE SUBSTRING(LOWER(LName), 1, 1)=@Filter
ORDER BY LName
)
Everytime I try to compile it in Query Analyzer, it gives me the following error: "Incorrect syntax near the keyword ORDER". If I run the query by itself, it runs with no errors.
Any ideas?
Thanks in advance.