Useful SQL queries to get to know that legacy db you are assigned:
select t.name, count(t.name)'count'
from sys.columns col
inner join sys.tables tab on col.object_id = tab.object_id
INNER JOIN sys.types t ON col.user_type_id = t.user_type_id
group by t.name
order by 'count' desc
name count
datetime 36
int 32
char 32
decimal 24
varchar 19
sysname 1
varbinary 1
Actually, turns out the sysdiagrams table will mess up your numbers. Mostly you'll get an extra sysname and varbinary (and 3 extra int values). So if you are using it to see which kind of types you have to contend with (as I was doing), know you can ignore those.
Also see:
http://itperfecting.blogspot.com/2007/06/t-sql-searching-through-schema.html
No comments:
Post a Comment