“sys.fm_my_permissions”抛出语法错误(

时间:2017-04-05 14:50:33

标签: java sql-server

当我尝试在sql server management studio 2012中执行以下查询时,它会显示Incorrect sytax near '('  在行 - fn_my_permissions(QUOTENAME

SELECT 
s.name,
o.name,
o.[type],
p.[permission_name]
FROM sys.objects AS o 
INNER JOIN sys.schemas AS s
ON o.[schema_id] = s.[schema_id]
CROSS APPLY sys.fn_my_permissions(QUOTENAME(s.name) 
+ N'.' + QUOTENAME(o.name), N'OBJECT') AS p
WHERE o.[type] IN (N'U', N'V',N'FN',N'TF',N'P',N'TR',N'SN') -- tables and views
AND p.subentity_name = N'' order by o.[type] ;

0 个答案:

没有答案