我有一个存储过程,它根据执行它的用户返回不同的结果。我的目的是让它返回相同的结果。我自己的用户获得了预期的结果(很多行),但是应用程序的服务帐户获得了一个空的结果集(并且没有错误)。
create procedure mal.get_geospatial_levels
as
set nocount on
select
level_name = c.name
from sys.objects o
inner join sys.columns c
on c.object_id = o.object_id
where o.name like 'mb%'
and c.name like '%[_]v%[_][0-9]%'
and c.name not like 'mb%'
and c.name not like 'admin%'
and c.name not like '%[_]name'
and c.name not in ('AREA_SQ_KM', 'OBJECTID', 'Shape')
group by c.name
order by c.name
如果查询在SSMS中自行执行,则会发生同样的事情。
我应该看什么?