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!

Comparing contents of two tables without hardcoding field names

Status
Not open for further replies.

bbbasket

Programmer
Joined
Jul 23, 2001
Messages
2
Location
US
Is there a way to compare the data in two tables without
hardcoding every field? I want to cycle thru each field name by somehow referencing the properties of a table.
 
Here is where the tables and column names are in Sql Server
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'

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top