Red Gate forums :: View topic - Bug on Find Invalid Objects
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Prompt 6
SQL Prompt 6 forum

Bug on Find Invalid Objects

Search in SQL Prompt 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
DanAvni



Joined: 15 Jun 2005
Posts: 48

PostPosted: Fri Aug 22, 2014 9:16 am    Post subject: Bug on Find Invalid Objects Reply with quote

I have the function below on a DB. the table ObjectPermissions does not exist anymore but the function does not list as an invalid object

ALTER FUNCTION [dbo].[CheckEnforceGroupPermissionsForEmployeeGUID]
(
@EmployeeGUID uniqueidentifier,
@EnforceGroupPermissionsForUserGuid uniqueidentifier
)
RETURNS bit
AS BEGIN
DECLARE @RetVal as bit
IF @EnforceGroupPermissionsForUserGuid is null
BEGIN
SET @RetVal = 1
end
ELSE
begin --running against a specific user
declare @GroupGUID uniqueidentifier
select @GroupGUID = GroupGuid
From Employees
Where Employees.Guid = @EmployeeGUID
if @GroupGUID is null
begin --no group for employee
SET @RetVal = 0
end
else
begin --employee has a group
if exists ( Select *
From ObjectPermissions
where ObjectGuid = @GroupGUID AND
UserGuid = @EnforceGroupPermissionsForUserGuid AND
ObjectType = 0 )
begin
SET @RetVal = 1
end
else
begin
SET @RetVal = 0
end
end
end
RETURN @RetVal

END
_________________
Dan Avni
Back to top
View user's profile Send private message
Aaron Law



Joined: 28 Jun 2013
Posts: 241
Location: Red Gate Software

PostPosted: Fri Aug 22, 2014 11:57 am    Post subject: Reply with quote

Hi Dan,

Thanks for your post, I can recreate this here and will look into seeing what we can do about fixing it.

Thanks,
Aaron.
Back to top
View user's profile Send private message
Aaron Law



Joined: 28 Jun 2013
Posts: 241
Location: Red Gate Software

PostPosted: Fri Aug 22, 2014 1:44 pm    Post subject: Reply with quote

Hi Dan,

We think we've got a fix for you, could you please give this private build a try and let us know if the function is correctly detected as invalid?

Thanks,
Aaron.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group