Storedprocedure Urgent Help!.......
Dear All.
i am working on storedprocedures. In my application i need to restrict the SYSTEM storedprocedures.i went through the API method getProcedureColumns() and not able to restrict the SYSTEM procedures using API. so,Can anyone suggest me a solution for this? An example on this will be appreciated.
Thanks and regards
gopal
[355 byte] By [
gopal73a] at [2007-9-27 23:20:58]

> Dear All.
> i am working on storedprocedures. In my application i
> need to restrict the SYSTEM storedprocedures.i went
> through the API method getProcedureColumns() and not
> able to restrict the SYSTEM procedures using API.
> so,Can anyone suggest me a solution for this? An
> example on this will be appreciated.
>
I'm not sure what you mean with restrict SYSTEM storedprocedures.
When you call getProcedureColumns() you don't want to include the sp's from the SYSTEM account. Is that what you mean?
When you iterate over the result set from getProcedureColumns() you simply ignore every entry where the schema == "SYSTEM".
Thomas
Dear Thomas,
Thank you for the response. yes you are right . i want to restrict the SYSTEM type STOREDPROCEDURES . There are some SYSTEM storedprocedures which starts with dt_addtosourcecontrol
and some with sp_add_server_sortinfo.
In my method getProcedures() i wrote like this.
ResultSet rs = databaseMetaData.getProcedures (null,null, "%");
while(rs.next()) {
String dbProcedureCatalog = rs.getString(1);
String dbProcedureSchema = rs.getString(2);
System.out.println("dbProcedureSchmeais :"+dbProcedureSchema);
}
when i tried to print this dbProcedureSchema i got dbo and not SYSTEM. so how can i restrict it ? can you just help me out.It is very urgent.
Thanks and Regards
gopal
I believe there is a system table which was some information which would let you determine which store procs were system and which were not.
Dear All,
Thanks for the responses. i am still in a dilema as how to restrict the System storedprocedures.
i have checked for System table and found none.i have come to a observation that this System storedprocedures starts with either dt_ or sp_. so can i make a comparsion like if the storedprocedure Name startsWIth dt_ or sp_ return without doing anything else proceed further. is this the correct way or is there any other way. i am trying to call this storedprocedures from my java application. any help will be appreciated.
Also please kindly suggest me any help on Storedprocedures.
bye
gopal
Dear All,
Thanks for the responses. i am still in a dilema as how to restrict the System storedprocedures.
i have checked for System table and found none.i have come to a observation that this System storedprocedures starts with either dt_ or sp_. so can i make a comparsion like if the storedprocedure Name startsWIth dt_ or sp_ return without doing anything else proceed further. is this the correct way or is there any other way. i am trying to call this storedprocedures from my java application. any help will be appreciated.
Also please kindly suggest me any help on Storedprocedures.
bye
gopal
Dear All,
Thanks for the responses. i am still in a dilema as how to restrict the System storedprocedures.
i have checked for System table and found none.i have come to a observation that this System storedprocedures starts with either dt_ or sp_. so can i make a comparsion like if the storedprocedure Name startsWIth dt_ or sp_ return without doing anything else proceed further. is this the correct way or is there any other way. i am trying to call this storedprocedures from my java application. any help will be appreciated.
Also please kindly suggest me any help on Storedprocedures.
bye
gopal
Dear All,
Thanks for the responses. i am still in a dilema as how to restrict the System storedprocedures.
i have checked for System table and found none.i have come to a observation that this System storedprocedures starts with either dt_ or sp_. so can i make a comparsion like if the storedprocedure Name startsWIth dt_ or sp_ return without doing anything else proceed further. is this the correct way or is there any other way. i am trying to call this storedprocedures from my java application. any help will be appreciated.
Also please kindly suggest me any help on Storedprocedures.
bye
gopal
Dear All,
Thanks for the responses. i am still in a dilema as how to restrict the System storedprocedures.
i have checked for System table and found none.i have come to a observation that this System storedprocedures starts with either dt_ or sp_. so can i make a comparsion like if the storedprocedure Name startsWIth dt_ or sp_ return without doing anything else proceed further. is this the correct way or is there any other way. i am trying to call this storedprocedures from my java application. any help will be appreciated.
Also please kindly suggest me any help on Storedprocedures.
bye
gopal
Dear All,
Thanks for the responses. i am still in a dilema as how to restrict the System storedprocedures.
i have checked for System table and found none.i have come to a observation that this System storedprocedures starts with either dt_ or sp_. so can i make a comparsion like if the storedprocedure Name startsWIth dt_ or sp_ return without doing anything else proceed further. is this the correct way or is there any other way. i am trying to call this storedprocedures from my java application. any help will be appreciated.
Also please kindly suggest me any help on Storedprocedures.
bye
gopal
> Dear Thomas,
> Thank you for the response. yes you
> esponse. yes you are right . i want to restrict the
> SYSTEM type STOREDPROCEDURES . There are some SYSTEM
> storedprocedures which starts with
> dt_addtosourcecontrol
> and some with sp_add_server_sortinfo.
>
>In my method getProcedures() i wrote like this.
>
> ResultSet rs = databaseMetaData.getProcedures
> ocedures (null,null, "%");
> while(rs.next()) {
> String dbProcedureCatalog = rs.getString(1);
> String dbProcedureSchema = rs.getString(2);
> System.out.println("dbProcedureSchmea
> ais :"+dbProcedureSchema);
>}
> when i tried to print this
> print this dbProcedureSchema i got dbo and not SYSTEM.
> so how can i restrict it ? can you just help me out.It
> is very urgent.
The schema in MS SQL Server is the table owner. In your case it's dbo. I don't think there is such thing as a SYSTEM owner in MS SQL Server.
Do I understand it correctly that with "restrict" you mean you want to hide these procedures when printing the list of procedures?
The only thing I can think of: you have to create the procedures using an account which does not have the DBA privilege. Thus the procedure will not be owned by dbo.
Or you could try to create the procedure explicitely for the user you are using:
CREATE PROCEDURE my-user.myProcedure
AS
...
Thomas
