I can get the number of columns in an SQL Server database with this:
SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'Address'
But is there any way (for an unknown number of columns) I can get the name and datatype and length of each column?
Instead of using
count(*) you can
SELECT * and you will return all of the details that you want including
SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'Address'
MSDN Docs on