Monday, February 20, 2012

ODBC in Stored Procedure

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 SQL Server stored
procedure?

Thanks a lotPumkin (PopClaudia@.gmail.com) writes:
> 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 SQL Server stored
> procedure?

You can't. Well, you could write an extended stored procedure or an
OLE object that you could call from a stored procedure, and that would
use these functions.

However, it would be more straight forward to query the system catalog
on the remote server directly.

What exactly are you trying to achieve?

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

No comments:

Post a Comment