Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 ODBC Issue

Author  Topic 

Pumkin
Starting Member

20 Posts

Posted - 2006-01-17 : 09:50:47
Hey guys,
I'm trying to get the column names from a table to which I'm connected through OBDC. I don't want to use linked server. I get my data with Openrowset.
I found the SQLDescribeCol and SQLColumns ODBC functions.
Can anybody tell me how to use those functions in a stored procedure?

Thanks a lot

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-01-17 : 10:06:10
If it is a SQL Server 7.0 or above database, try this query.

select
*
from
INFORMATION_SCHEMA.COLUMNS
where
TABLE_SCHEMA = 'dbo' and
TABLE_NAME = 'MyTableName'



CODO ERGO SUM
Go to Top of Page

Pumkin
Starting Member

20 Posts

Posted - 2006-01-17 : 10:18:39
The problem is that the table I want to get the column_name is on a different machine and I access it through ODBC. My machine is SQL Server 7.0 but the other isn't.
It doesn't work quering INFORMATION_SCHEMA. :(
Go to Top of Page
   

- Advertisement -