22 / 12 / 13

sql server 相关

查询数据库中所有的表名及行数 参考链接:链接1

SELECT     a.name, b.rows
FROM         sys.sysobjects AS a INNER JOIN
                      sys.sysindexes AS b ON a.id = b.id
WHERE     (b.indid IN (0, 1)) AND (a.type = 'u') AND a.name LIKE '%SWT%'
ORDER BY b.rows DESC

获取指定表列名 参考链接:链接2

Select Name FROM SysColumns Where id=Object_Id('tableName')
Powered by Gridea