in reply to What is similar in mssql to $dbh->listfields($tbl) in mysql

You can use the following query to get the columns in a table from MS SQL Server:

select from syscolumns join sysobjects on = where = ?
(you supply the table name as the argument to execute to provide the data for the placeholder.

Alternatively you can use the INFORMATION_SCHEMA view which basically does the same thing:

select COLUMN_NAME from information_schema.columns where table_name = ?