Sybase查询所有表记录数、表大小、指定条数查询
表记录数、表大小
select user_name(a.uid) as table_schema,a.name as table_name,SUM(row_count(db_id(), a.id)) table_rows ,data_pages(db_id(), a.id, 0) * (@@maxpagesize) as table_size from dbo.sysobjects a where a.type = 'U' and a.name = '指定表名' AND user_name(a.uid)='命令空间' GROUP BY user_name(a.uid),a.name
查询表字段
SELECT a.name AS col_name, b.name AS data_type FROM syscolumns a inner join systypes b ON a.type = b.type and a.usertype=b.usertype inner join sysobjects c ON a.id = c.id WHERE c.name = '指定表名' AND c.type = 'U' AND c.uid = USER_ID('命名空间');
查询前10条数据
select TOP 10 * FROM [命名空间].[表名]
-----------------------有任何问题可以在评论区评论,也可以私信我,我看到的话会进行回复,欢迎大家指教------------------------
(蓝奏云官网有些地址失效了,需要把请求地址lanzous改成lanzoux才可以)