Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 1st, 2006, 02:35 AM
Registered User
 
Join Date: Dec 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Finding Column Name

Hi,
  I have a database which contains 479 tables,I want to find a column in these table.
let say emp_id,i have to find this column in these tables.
how can we do that.
please help me

Thanks,
Prabhakaran
 
Old December 1st, 2006, 08:13 AM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
Default

One way would be to use [Tools][Object Search][New] in Query Analyzer.

So would this...
Code:
 SELECT so.Name AS TableName,
        sc.Name AS ColumnName
   FROM dbo.SysObjects so,
        dbo.SysColumns sc
  WHERE so.ID = sc.ID
    AND so.XType = 'U' --User table
    AND sc.Name = 'PutColNameHere'
  ORDER BY TableName
--Jeff Moden
 
Old December 4th, 2006, 01:19 AM
Registered User
 
Join Date: Dec 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a lot Jeff .T-SQL code works well..

Thanks,
Prabhakaran
 
Old December 4th, 2006, 09:36 AM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
Default

Thank you for the feedback.

--Jeff Moden





Similar Threads
Thread Thread Starter Forum Replies Last Post
[VB2005]Finding last cell of the column in excel bellaelysium Visual Basic 2005 Basics 2 June 22nd, 2008 11:33 PM
Finding Column Range Nocturnl Excel VBA 3 December 29th, 2007 11:36 AM
Finding Primary Key Column in Script johnpirkey SQL Server 2000 9 April 26th, 2007 10:06 AM
finding and populating next available column rlrigsby Excel VBA 0 April 14th, 2006 04:08 PM
Compare two Items of data(in column A and column B ever Excel VBA 6 February 13th, 2004 02:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.