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!

sys_objects 2

Status
Not open for further replies.

dmando84

Programmer
Dec 28, 2005
68
US
Hello,

I am searching for a specific column name in a database. I am unsure what the syntax is. This is what I have so far, but it is returning an error...

select * from sys_objects where col_name = 'ProductID'

Does anyone know the correct syntax? Any help would be appreciated.

Thank you,
Dave
 
These will work for you.

--gets all tables with "program" in the name
SELECT Name
FROM sysobjects
WHERE xtype ='u' --filter to table system objects
AND name LIKE '%program%'


--gets all columns and tables
SELECT SC.Name AS ColumnName
,SO.Name AS TableName
FROM syscolumns SC
JOIN sysObjects SO
ON SC.ID = SO.ID
WHERE SC.name LIKE '%'

- Paul
- Database performance looks fine, it must be the Network!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top