hi below is SP:
ALTER procedure [dbo].[Select_DocTopicMain]
as
begin
SET NOCOUNT ON
select Distinct Topic,TopicId
from Documentry_Info
WHERE Topic IS NOT NULL
order by Preference asc
end
but this error happen:
ORDER BY items must appear in the select list if SELECT DISTINCT is specified.
Best Regards
Neda