How to retrieve all the rows of a system table whose TABLE_SCHEMA is sys and whose database is master/tempdb ?



Question
How to retrieve all the rows of a system table whose TABLE_SCHEMA is sys
and whose database is master/tempdb from SQL Server Express 2005
using OLE DB Provider for SQL Native Client?

Method One
1. retrieve all column names using OpenSchema(adSchemaColumns,varData)
2. use SELECT c1, c2, c3, ... , cN FROM sys.system_table_name

Method Two
1. use SELECT * FROM sys.system_table_name

I have tried using the above two methods without success.

Did I miss something ?
Do I need any special permission to open a particular system table ?

Method Three
1. use m_pRecordset->Open((LPCTSTR)strSystemTableName,
_variant_t((IDispatch*)mpdb, TRUE),
adOpenForwardOnly, adLockReadOnly, adCmdTable);

I do not wish to use method three. Are there any other solutions to my
concern?

Thank you very much for your reply.


.



Relevant Pages

  • Re: Newbie help
    ... think I can probably get what I need using SQL Server (the ... > To efficiently store and retrieve data for your needs, ... You only store changed values (as ...
    (microsoft.public.sqlserver.programming)
  • Re: SqlServer 2005 Transfer Flame
    ... database between the two servers. ... I do understand your concerns with SQL Server 2005. ... Drag a OLE DB Destination to the panel; ...
    (microsoft.public.sqlserver.dts)
  • Re: JDBC - Cant get unicode with ResultSet.getString()
    ... The column is a nvarchar and I use ResultSet.getStringto retrieve it. ... >> The data is correct in Sql Server - I viewed it there. ... >> And it is the jdbc getString() that returns it wrong, ...
    (microsoft.public.sqlserver.odbc)
  • Re: a view based on stored procedure
    ... Columnist, SQL Server Professional ... When I execute the stored procedure in Query Analyzer, ... OLE DB error trace [Non-interface error: OLE DB provider unable to process ... In the stored procedure, I am selecting data from 2 views, opening a cursor, ...
    (microsoft.public.sqlserver.programming)
  • Re: Samplclnt example in MDAC 2.8: My Story
    ... It's funny how Microsoft appears to be pushing OLE DB hard, ... > people seem reluctant to abandon ODBC, and again, I've heard from ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (microsoft.public.data.oledb)