table names collection in SQL Server 2000
Need your help plzzzzzzzzz....
i need to extract table and fiald names in visual C++ from an SQL database and use these table nad field names to perform String matching with a Natural language in a Natural language query analyzer. i don't know how to extract these names. Is there a direct SQL Query with which i can obtain these names?
Re: table names collection in SQL Server 2000
OpenSchema if U use ADO/oledb. There is also similar function in ODBC.
As a "direct query" U can use some standard stored procedures:
EXEC sp_tables
EXEC sp_pkeys
etc.
OR U can select directly from system tables...
(sysobjects,syscolumns,....)
Best regards,
Krzemo.
Re: table names collection in SQL Server 2000
Have a look at the INFORMATION_SCHEMA.* views,
e.g.
Code:
select * from information_schema.tables