Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting an entire row or column without knowing the name

Status
Not open for further replies.

Guest_imported

New member
Joined
Jan 1, 1970
Messages
0
How can i select entire rows and coloumns in MS SQL server?? i need a statement that will allow me to do this because i am using vc++ and transfering the database tables to a listbox....but I wont know what the name of each column or table is...
 
try this
select SO.Id,
TableName = SO.Name,
ColumnName = SC.name

from Sysobjects SO
Inner join Syscolumns SC on SO.id = SC.id
where SO.TYpe = 'U'

notes : type 'U@ is for user type tables in the sysobjects table for that database.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top