Re: Re: MSSQL DataObject - support for listing tables in mssql.php
| From: | Alan Knowles | Date: | Fri, 10 Jan 2003 15:36:09 +0000 |
| Subject: | Re: Re: MSSQL DataObject - support for listing tables in mssql.php | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-12242@lists.php.net to get a copy of this message | ||
I think I confused things there - looks like tableInfo works OK, it was the
select name from sysobjects where type = 'U' order by name
(for listing tables, rather than table definitions)
which Mike has been told that
select * from dbo.sysobjects where (OBJECTPROPERTY(id, N'IsUserTable') = 1) order by name;
is the optimimal way to list table names
Regards
Alan
Markus Wolff wrote:
Am Fri, 10 Jan 2003 22:43:30 +0800 schrieb Alan Knowles <alan@akbkhome.com>:-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.comActually, The original comment was based around the old way I used to gather table data : being describe tables..... now it uses pear's $db->tableInfo(); which is in DB/mssql.php which appears to just raise an error.. I've passed this on to sterling (cc'ing pear-dev)- as he's listed as the author for that file... To see if he thinks the code below is valid to go into mssql.php to allow it to support table listing..On which OS did you try this? If you´re on Linux and have enabled MSSQL support using --with-sybase, the tableInfo() method won´t work as the needed functions are not supported by the Sybase driver. AFAIK, as of PHP 4.3.0 you should be able to use --with-mssql on Linux so the full set of functions provided by this extension should be available - I haven´t tried it yet, though. If you´re on Windows, tableInfo() for MSSQL will work just fine even with older PHP versions. Regards, Markus