比如某个数据库中有20个表。
有什么方法,能快速生成20条这样select语句?
select top 10 * from 表1
select top 10 * from 表2
.
.
.
slect top 10 * from 表20
------解决方案--------------------
- SQL code
use CSDNgoselect 'select top 10 * from ' + quotename(name)from sys.tableswhere type = 'u'
use CSDNgoselect 'select top 10 * from ' + quotename(name)from sys.tableswhere type = 'u'