Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by gellyfish (Monsignor)
on Oct 24, 2006 at 11:53 UTC ( #580248=note: print w/ replies, xml ) Need Help??


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 syscolumns.name from syscolumns join sysobjects on sysobjects.id = syscolumns.id where sysobjects.name = ?
(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 = ?

/J\


Comment on Re: What is similar in mssql to $dbh->listfields($tbl) in mysql
Select or Download Code
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://580248]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (13)
As of 2015-07-07 22:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls