By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,504 Members | 1,187 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,504 IT Pros & Developers. It's quick & easy.

Select from Stored Procedure

P: 5
Hi,


Please help. I am very new to SQL server.

I run :

sp_helprotect erwin123

Owner object grantee grantor protecttype action coloumn
dbo erwin123 developer_user dbo Deny Select (All+New)
dbo erwin123 laue dbo Grant Select(All+New)

If I Just want to get the 3rd column which in grantee, what manipulation on stored procedure can I use.

I've tried something like

select grantee from (exec sp_helpprotect erwin123) and it does not work.

Thanks in advance for your advice
Mar 15 '08 #1
Share this Question
Share on Google+
4 Replies


Delerna
Expert 100+
P: 1,134
Hi,
I've tried something like

select grantee from (exec sp_helpprotect erwin123) and it does not work.
Hi lawardy
You cannot query a stored procedure like that.
Mar 17 '08 #2

ck9663
Expert 2.5K+
P: 2,878
You can try converting the sp into a table-function

-- CK
Mar 17 '08 #3

P: 5
Hi,

I manage to do it by creating a Temp table. However it only work as long as the SP_* return only 1 rowset.

Something like SP_HELP which return multiple rowset may need another trick
Mar 19 '08 #4

ck9663
Expert 2.5K+
P: 2,878
As everyone recommended, try function

-- CK
Mar 19 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.