re SQL Server Database queries

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

re SQL Server Database queries

Ronald Hallam
I am trying to access the metadata of  mainly MicroSoft SQL server 6.5 /7
databases for an analysis tool.   In DBConnection there are methods called
'procedure: owner: name:' and 'procedures', the second one is the most
obvious one that I require to start with as I require all the stored
procedures relating to the database, yet when I run it against a database
with 172 stored porcedures the recsult set is empty, is there  a bug in the
method? A similar thing happens with the first method.


    If I run the  following 'select name from sysobjects where type='P',
when attached to the database the whole of the list of procedures is
returned.


    I subsequent want to query the database to get both the tables and
fields that each stored procedure uses.


    As anyone done anything similar, preferably using the base methods in
the image, otherwise I will have to write my own.


    Ron


Reply | Threaded
Open this post in threaded view
|

Re: re SQL Server Database queries

Bill Schwab-2
Ron,

> I am trying to access the metadata of  mainly MicroSoft SQL server 6.5 /7
> databases for an analysis tool.   In DBConnection there are methods called
> 'procedure: owner: name:' and 'procedures', the second one is the most
> obvious one that I require to start with as I require all the stored
> procedures relating to the database, yet when I run it against a database
> with 172 stored porcedures the recsult set is empty, is there  a bug in
the
> method? A similar thing happens with the first method.

This could way off base, but, what you are describing sounds similar to the
key field methods that turn out to be (IIRC) dependent on things that are
not included in Dolphin.  OA (well, probably Intuitive at that point) was
working on a RDB-OO mapping tool, and there are some dangling references to
it.


>     If I run the  following 'select name from sysobjects where type='P',
> when attached to the database the whole of the list of procedures is
> returned.

Interesting - thanks for passing this along.

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: re SQL Server Database queries

Ronald Hallam
Bill
    thanks for the info.

    Here is a small workspace item that you can obtain the stored procedures
that have the tables dependent  on them.

    |a b s c|
a := (DBConnection new)open.
s := a tables.
1 to: s size do:[:x |
b := a query:('select o.name,
  type = substring(v.name, 1, 16)
   from sysobjects o, master.dbo.spt_values v, sysdepends d,
    sysusers s
   where o.id = d.id and o.name not like ''odbc#%''
    and o.sysstat & 0xf = v.number and v.type = ''O''
    and d.depid = (select id from sysobjects where name=''',(s at: x),''')
    and o.uid = s.uid
    and v.name not like ''trigger%''').
b first.
c := b at:1]

    I cannot get down to field level, but at least I can arrange to have the
application interrogate the various databases, to get the various
information automatically.

      I am turning it into a method for use by my application, which will
show the links betrween the various tables,stored procedures and the front
ends on the systems that we work on in the office.  They do not use
smalltalk there but lets show them how quick you can get a decent
application out..

Ron

Bill Schwab wrote in message <9rcm7q$spqhg$[hidden email]>...
>Ron,
>
>> I am trying to access the metadata of  mainly MicroSoft SQL server 6.5 /7
>> databases for an analysis tool.   In DBConnection there are methods
called

>> 'procedure: owner: name:' and 'procedures', the second one is the most
>> obvious one that I require to start with as I require all the stored
>> procedures relating to the database, yet when I run it against a database
>> with 172 stored porcedures the recsult set is empty, is there  a bug in
>the
>> method? A similar thing happens with the first method.
>
>This could way off base, but, what you are describing sounds similar to the
>key field methods that turn out to be (IIRC) dependent on things that are
>not included in Dolphin.  OA (well, probably Intuitive at that point) was
>working on a RDB-OO mapping tool, and there are some dangling references to
>it.
>
>
>>     If I run the  following 'select name from sysobjects where type='P',
>> when attached to the database the whole of the list of procedures is
>> returned.
>
>Interesting - thanks for passing this along.
>
>Have a good one,
>
>Bill
>
>--
>Wilhelm K. Schwab, Ph.D.
>[hidden email]
>
>
>