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:
(you supply the table name as the argument to execute to provide the data for the placeholder.select syscolumns.name from syscolumns join sysobjects on sysobjects.id = syscolumns.id where sysobjects.name = ?
Alternatively you can use the INFORMATION_SCHEMA view which basically does the same thing:
select COLUMN_NAME from information_schema.columns where table_name = ?
/J\
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: What is similar in mssql to $dbh->listfields($tbl) in mysql
by VSarkiss (Monsignor) on Oct 24, 2006 at 15:19 UTC |
In Section
Seekers of Perl Wisdom