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

Tech-Archive recommends: Fix windows errors by optimizing your registry



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: Is ADO.NET OleDb .NET Data Provider a COM object?
    ... Okay, okay... ... OLE DB is a one-size-fits-all set of providers that can access anything from a relational database to a tuna salad. ... in order to access SQL Server we used OLE DB to access ODBC or SQL Server. ... In a similar way, just because you can connect to MySQL, Paradox, Oracle or FarkleStar databases from an OLE DB or other OSFA provider does not mean your code can interface with these other back-ends. ...
    (microsoft.public.dotnet.framework.adonet)
  • 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)