如果是SQL server 可以使用:select * from sys.objects where type = 'U'如果是oracle可以使用:select * from dba_tables;但是因为变量只能存储一个值,所以不知道你的查询所有表名,存放到变量中,好象不行。