Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 141253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:44:48+00:00 2026-05-11T07:44:48+00:00

I would like to search an entire MS SQL 2000 database for one value.

  • 0

I would like to search an entire MS SQL 2000 database for one value. This would be to aid development only. Keep that in mind when considering this question.

This will get all the table names and the column of the data type I’m looking for:

SELECT Columns.COLUMN_NAME, tables.TABLE_NAME FROM INFORMATION_SCHEMA.Columns as Columns  JOIN INFORMATION_SCHEMA.TABLES as tables  On Columns.TABLE_NAME = tables.TABLE_NAME WHERE Columns.DATA_TYPE = 'INT'   

I was thinking something like this:

-- Vars DECLARE @COUNTER INT DECLARE @TOTAL INT DECLARE @TABLE CHAR(128) DECLARE @COLUMN CHAR(128) DECLARE @COLUMNTYPE CHAR(128) DECLARE @COLUMNVALUE INT  -- What we are looking for SET @COLUMNTYPE = 'INT' SET @COLUMNVALUE = 3 SET @COUNTER = 0  -- Find out how many possible columns exist SELECT @TOTAL = COUNT(*)   FROM INFORMATION_SCHEMA.Columns as Columns  JOIN INFORMATION_SCHEMA.TABLES as tables  On Columns.TABLE_NAME = tables.TABLE_NAME WHERE Columns.DATA_TYPE = @COLUMNTYPE PRINT CAST(@TOTAL AS CHAR) + 'possible columns' WHILE @COUNTER < @TOTAL BEGIN     SET @COUNTER = @COUNTER +1     -- ADD MAGIC HERE END 

Any ideas?

UPDATE I recently found this tool that works quite well.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T07:44:49+00:00Added an answer on May 11, 2026 at 7:44 am

    Since it is dev only (and probably doesn’t have to be very elegant), how about using TSQL to generate a pile of TSQL that you then copy back into the query window and execute?

    SELECT 'SELECT * FROM [' + tables.TABLE_NAME + '] WHERE ['        + Columns.Column_Name + '] = ' + CONVERT(varchar(50),@COLUMNVALUE) FROM INFORMATION_SCHEMA.Columns as Columns INNER JOIN INFORMATION_SCHEMA.TABLES as tables      On Columns.TABLE_NAME = tables.TABLE_NAME WHERE Columns.DATA_TYPE = @COLUMNTYPE 

    It won’t be pretty, but it should work… an alternative might be to insert something like the above into a table-variable, then loop over the table-variable using EXEC (@Sql). But for dev purposes it probably isn’t worth it…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 94k
  • Answers 94k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I'm not sure how to do it w/o a BindingSource,… May 11, 2026 at 6:47 pm
  • Editorial Team
    Editorial Team added an answer I've had to deal with date collision issues alot lately,… May 11, 2026 at 6:47 pm
  • Editorial Team
    Editorial Team added an answer If you create your view using a nib file then… May 11, 2026 at 6:47 pm

Related Questions

I have a question about this question . I posted a reply there but
Say that I write an article or document about a certain topic, but the
I'm really interested in speech-to-text algorithms, but I'm not sure where to start studying
First post, so here goes. I'm writing a script that does intelligent search and

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.