Groups | Blog | Home
all groups > sql server connect > june 2007 >

sql server connect : SQL Server 2005 with VB.net 2005


Omar Abid
6/9/2007 12:00:00 AM
Hi every body,
Im using VB 2005 to create a program that open SQL Data base
The problem that i want to detect the tables of a database
so how can i know a data base tables instantly
Thank you
omar.abid@hotmail.com
omar.abid2006@gmail.com
Omar abid
Russell Fields
6/9/2007 12:00:00 AM
Omar,

For tables to which the user has rights:
EXEC sp_tables

For all tables:
In SQL Server 2000 and 2005
SELECT * FROM INFORMATION_SCHEMA.TABLES

In SQL Server 2005
SELECT * FROM sys.tables

For SQL Server 2005 permissions to this information is more restricted and
may require the user to have VIEW DEFINITIONS rights in order to see
everything.

RLF

[quoted text, click to view]

Omar Abid
6/11/2007 12:00:00 AM
[quoted text, click to view]

thx, but how to get the tables name into strings ?
Russell Fields
6/12/2007 12:00:00 AM
Omar,

All of these commands return rowsets. Just read the rows from your query
and do whatever you want in VB, such as putting then into a string array.
(If I understand your question.)

RLF
[quoted text, click to view]

AddThis Social Bookmark Button