where can i find the source code for predefined system procedure like CALL sa_table_page_usage(), CALL sa_table_stats(), CALL sa_table_fragmentation() etc..

asked 23 Jan '19, 02:24

manvith's gravatar image

manvith
11112
accept rate: 0%


While you might view the source code using this SQL statement

select proc_defn 
from sys.sysprocedure 
where proc_name = 'sa_table_page_usage'
you won't get much information apart form the parameter declaration. System procedures call interal functions whose code isn't accessible.

permanent link

answered 23 Jan '19, 04:20

Reimer%20Pods's gravatar image

Reimer Pods
4.5k384891
accept rate: 11%

edited 23 Jan '19, 04:20

I appreciate your answer but i want to know the query behind the procedure call so then i can know which tables they are using.

(23 Jan '19, 04:42) manvith
Comment Text Removed

System procedures call interal functions whose code isn't accessible.

I think that is different for different system procedures, some do contain their definition, others call internal procedures, and some do some stuff and then call internal procedures.

(23 Jan '19, 05:05) Volker Barth

In addition to Reimer's answer, you may get more hints when searching within this forum, e.g. here is a discussion what the internal gear behind sa_table_fragmentation() might query:

What is the Sybase Central 16 "Fragmentation" tab showing?

Of course that usually won't answer what exact query the stored procedures perform if that is not contained within the SYSPROCEDURE's contents. Note, for sa_table_stats() and sa_table_fragmentation() the procedures's definitions is documented there - for the latter, at least partly.

permanent link

answered 23 Jan '19, 04:57

Volker%20Barth's gravatar image

Volker Barth
40.2k361549822
accept rate: 34%

edited 23 Jan '19, 05:02

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×128
×32
×11
×9
×9

question asked: 23 Jan '19, 02:24

question was seen: 1,444 times

last updated: 23 Jan '19, 05:05