473,323 Members | 1,547 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Finding a column in a database

Hi all,

How do I find all tables containing a column (say a column including
the string 'value')?
Thanks

Bruno

Jul 23 '05 #1
2 2369
SELECT sysCol.Name, sysType.name
FROM syscolumns sysCol
INNER JOIN sysobjects sysObj ON sysCol.id = sysObj.id
INNER JOIN systypes sysType on sysCol.xtype = sysType.xtype
WHERE sysObj.name ='<TABLE NAME>'
best Regards,
Chandra
http://groups.msn.com/SQLResource/
http://chanduas.blogspot.com/
---------------------------------------

*** Sent via Developersdex http://www.developersdex.com ***
Jul 23 '05 #2
If you mean a column with 'value' in the column name (not in the data),
then there are a couple of ways:

select object_name(id), name
from syscolumns
where name like '%value%'

Or if you want a portable solution, you can use the INFORMATION_SCHEMA
views:

select TABLE_NAME, COLUMN_NAME
from INFORMATION_SCHEMA.COLUMNS
where COLUMN_NAME like '%value%'

Books Online has more information about syscolumns and the views.

Simon

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: rnewman | last post by:
I have a task to where I need to move a column from one table to another. I want to be sure I update any view, stored procedure, trigger, etc. that references the column. I simply want a query that...
5
by: Chad | last post by:
Could any suggest to me a good way to programmatically identify which SPs update a database column. I would like to create a cross reference for our database.
2
by: Roger Withnell | last post by:
How do I find the maximum value of a recordset column? I'd rather do it this way than open a new recordset with Max(column). Thanks in anticipation. Posted Via Usenet.com Premium Usenet...
6
by: Maxi | last post by:
I have 100 tabes in an Access database, every table has 1 filed with 100 names (records), no primary key assigned. I would like to find duplicates. Here is the criteria: The computer should...
2
by: Eric | last post by:
I'd like to write an app for testing how well my application works with a really large database. I also want to be able to use it again for other projects. Is it possible, once connected to a...
3
by: louise raisbeck | last post by:
Hi there, I have a brain block on finding a repeater item which matches a field from the row of the datasource. If my datasource has a column called 'somethingid' i want to find the repeateritem...
1
by: Vikramaditya Singh | last post by:
in vb.net i want to find out database column type, wether it is string or number . How can i do this thanks
3
by: DavidB | last post by:
New to .net....sorry if this seems repetitive I have a dataset ordered by date (SQLDataAdapter SelectCommand uses Order By) and want to find a record by a UniqueID(Identity Column). Then I want...
2
by: pawanez4u | last post by:
Hi Every one, I want to find whether a particular column in a SQL database table exists or not which the "column name". Kindly help me with the appropriate. Thanks in Advance. Regards ...
1
by: Deepmala26 | last post by:
Hi, I m doing a project in VB.NET. I've created form and database connectivity is done. I've displayed data in Datagrid through which user can sort and find records. for finding...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.