Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 .NET Inside SQL Server (2005)
 How to search all columns of all tables in a datab

Author  Topic 

abdul gani
Starting Member

3 Posts

Posted - 2008-12-13 : 21:45:30
Dear Team,

i have an requirement that : i want to search all the columns of all the tables in the particular database based on the specific key word or an free text.

example :

table 1: columns data
empname sam
empid 01

table 2 columns data
deptname sam
departmentid 10

table 3 columns data
organization name sam
organization id 1

when i search for text " SAM"

it should search me from the entire database, all tables and columns of it and display the result

output : tablename cloumn value
table1 empname sam
table2 deptname sam
table3 organizationame sam

the example is just an sample not the real data .

please help me with sample code or any link related to it .


thanks in advance


shaik abdul gani

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-13 : 22:11:15
http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm
Go to Top of Page

abdul gani
Starting Member

3 Posts

Posted - 2008-12-13 : 22:22:07
I have tried this procedure . but it is very time consuming . for around 450 mb database it is aking 2.30 mins. but here i have around 4 to 8 gb.. is there any alternative solution for this. please help me out
thanx in advance

shaik abdul gani
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-12-14 : 11:09:15
Yes it will consume time if database is huge.You have create script like Vyas which is more efficient.
Go to Top of Page
   

- Advertisement -