SQL – getting table info
Sometimes I’ve had the need to use SQL to go and get table information i.e is a field varchar or int etc.
For MS SQL server you can use the following to get info on a table
SELECT RIGHT(syscolumns.name, LEN(syscolumns.name)) AS dbFieldName, systypes.name AS typename, syscolumns.length AS maxlength, syscolumns.xprec AS [precision], syscolumns.xscale AS scale, syscolumns.isnullable AS isnullable
FROM [...]























Recent Comments