DisCopy


Thursday 27 March 2014

To get Rowcounts of Sybase ASE and ASA databases..

You can use the following Queries to get rowcounts for all the tables in Sybase.

for ASE:

This is a generic T-SQL script that would select all the tables and then does a row count of all tables in a Sybase ASE Database.

versions < 15.x

select o.name, rowcnt (i.doampg)
from sysobjects o, sysindexes i
where o.type = 'U'
and i.id = o.id
and i.indid < 2 

versions 15.x

select name, rowcnt(sysindexes.doampg)
from sysindexes
where name in
(select name from sysobjects where type = "U")
order by name


This is a generic T-SQL script that would select all the tables and then does a row count of all tables in a Sybase ASA Database.

for ASA:

select table_name, count
from systable
where primary_root<>0 and creator=1
order by 1

2 comments:

  1. Anniya,

    I just started concentrating on sybase preparation from your blogs :)

    Excellent info you posted.

    Regds
    Rajasekhar Reddi

    ReplyDelete
  2. sybase online training| sybase training| call us+ ...
    www.21cssindia.com/courses/sybase-online-training-159.html
    sybase training,introduction to sybase,employee training, sybase online training e-learning,sybase tutorial,online course.Many more… | Call Us +917386622889
    Visit: http://www.21cssindia.com/courses.html

    ReplyDelete