messages from view/procedure 
Author Message
 messages from view/procedure

hi,

I am trying to figure out how to trigger the display of a message [at
client] from within a view or procedure.

We have a [3rd party] application that handles security[access] thusly;
====================
select a.*

From bEMRD a

Where exists (select *

from bDDDU c1

Where a.EMCo = c1.Qualifier

and isnull (Convert(varchar(30),a.Employee),c1.Instance) = c1.Instance

and c1.Datatype ='bEmployee' and c1.VPUserName=suser_sname()) or
suser_sname() = 'admin'

====================
the statement would normally be;
select a.* From bEMRD a

the bDDDU table stores said user security information by tables/datatypes
etc.
====================

The views are regenerated based on users selected, etc....

What this means is that if you open a view/run a procedure handles this way
you simply get an empty return set. It would be much better to be able to
display a message indicating lack of permissions, etc.

Any ideas on where I might look for a solution?

TIA
B



Mon, 15 Nov 2004 00:34:04 GMT
 messages from view/procedure

I re-read post later and realized it fell short of asking what I was really
trying to figure out ;-)...

I figured I could use RAISEERROR('',x,y) - but...

I was unable to figure out how to come up with a boolean result for the
WHERE cluase shown to both limit as it does, AND provide a method for
determining whether or not RAISEERROR should be invoked?

Maybe to encase it in an IF NOT Empty() RaiseError ELSE select...  but then
executing twice? overhead?

any ideas?

TIA
B


Quote:
> hi,

> I am trying to figure out how to trigger the display of a message [at
> client] from within a view or procedure.

> We have a [3rd party] application that handles security[access] thusly;
> ====================
> select a.*

> From bEMRD a

> Where exists (select *

> from bDDDU c1

> Where a.EMCo = c1.Qualifier

> and isnull (Convert(varchar(30),a.Employee),c1.Instance) = c1.Instance

> and c1.Datatype ='bEmployee' and c1.VPUserName=suser_sname()) or
> suser_sname() = 'admin'

> ====================
> the statement would normally be;
> select a.* From bEMRD a

> the bDDDU table stores said user security information by tables/datatypes
> etc.
> ====================

> The views are regenerated based on users selected, etc....

> What this means is that if you open a view/run a procedure handles this
way
> you simply get an empty return set. It would be much better to be able to
> display a message indicating lack of permissions, etc.

> Any ideas on where I might look for a solution?

> TIA
> B



Mon, 15 Nov 2004 04:26:40 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. stored procedure for viewing views...

2. Please help to convert view on views to stored procedure

3. Please help to convert view on views to stored procedure

4. View what stored procedures are currently in the procedure cache

5. temporary tables in stored procedures/parameter views vs stored procedures

6. Stored procedure dependancy on tables, views and other stored procedures

7. Error message exceeding limit of 16 tables/views

8. error message: table or view existed when creating a table

9. Displaying page views for messages in Discussion Board

10. Access ADO.Errors to view SQL Print messages

11. error message viewing output request

12. Timeout expired message running View in Enterprise Manager


 
Powered by phpBB® Forum Software