Page 1 of 1

Whats problem with this Query?

Posted: 25.08.2011, 20:27
by saulofg
Whats problem with this Query?

select 'grant exec on ' + 'sp_name' + ' to ' + su.name as granttext
from db..sysobjects so,
db..sysprotects sp,
db..sysusers su
where so.name = 'sp_name '
and sp.id = so.id
and su.uid = sp.uid
order by su.name

on Sybase 12, Delphi 7.

the TZQuery always give a error message:
Row data is not avaliable

Re: Whats problem with this Query?

Posted: 19.03.2014, 11:47
by kaiserilich
use this

Code: Select all

select 'grant exec on ' + 'sp_name' + ' to ' + su.name as granttext 
from sysobjects so, 
sysprotects sp, 
sysusers su 
where so.name = 'sp_name ' 
and sp.id = so.id 
and su.uid = sp.uid 
order by su.name