By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,729 Members | 1,363 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,729 IT Pros & Developers. It's quick & easy.

read mssql field type from php

P: n/a
Hi,

this question is 50% mssql and 50% php. To get field definitions and other
informations for table 'myTable', I use with sql server:

EXEC sp_help myTable

The problem with php is this command returns several result sets, and
informations about field types is not in the first one. If I query mssql
from php and fetch result, I only get informations about the first one, and
php completetly ignores the other one.

Is there a mean to read other result sets, or is there another sql command
that returns field definition?

Thanks
Thierry B.

--
Click below to answer / cliquez ci dessous pour me repondre
http://cerbermail.com/?MQkxTL4vUP

Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Thierry B." <th********@dummy.com> a écrit dans le message de
news:c4**********@news-reader1.wanadoo.fr...
Hi,

this question is 50% mssql and 50% php. To get field definitions and other
informations for table 'myTable', I use with sql server:

EXEC sp_help myTable

The problem with php is this command returns several result sets, and
informations about field types is not in the first one. If I query mssql
from php and fetch result, I only get informations about the first one, and php completetly ignores the other one.

Is there a mean to read other result sets, or is there another sql command
that returns field definition?


Sorry I just found,
EXEC sp_columns @table_name = 'myTable'
, or
SELECT c.name, t.name
FROM syscolumns c, systypes t, sysobjects o
WHERE o.name = 'myTable' AND o.id = c.id AND c.xtype = t.xtype
Thierry B.
--
Click below to answer / cliquez ci dessous pour me repondre
http://cerbermail.com/?MQkxTL4vUP

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.