senôr Noci
8th July 2003, 17:42
Hi all,

I have a question

Does anyone know is there a sql-script
to find out the size of a company inside a sql-server database?
or otherways to find out

thanks for reply
greetz,

senôr Noci

benito
8th July 2003, 19:05
try this script:

use baandb
select 'exec sp_spaceused ' + name from sysobjects where
name like '%500'


where 500 is your company number. then it will generate something like below:

exec sp_spaceused tcprmp130500
exec sp_spaceused tcprmp138500
exec sp_spaceused tcprmp140500
exec sp_spaceused tcprmp150500
exec sp_spaceused tcprmp300500
exec sp_spaceused tcprmp420500
exec sp_spaceused tcprmp450500
exec sp_spaceused tcprmp460500
etc.etc.

run the results and you should have the size of your company.

Djie-En
9th July 2003, 09:57
Hi,

Why not using session ttaad4222m000?
It reports the number of records and the space it is using.

GN

zardoz
9th July 2003, 13:10
No, the session ttaad4222m000 gives only an 'idea' of the space, not the real thing...
If you use Oracle, any 'number' field always occupies 16bytes , even if the field is declared byte in Baan Tools, because the Database driver uses alway the "NUMBER" oracle data type.