SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 patIndex question
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bbasir
Yak Posting Veteran

76 Posts

Posted - 04/23/2008 :  19:11:22  Show Profile  Reply with Quote
patindex compares a string with a column in a databse table....

I need to compare column a in a table1 with column b in table 2

is there a wfunction where I could compare using column names.

basically I need a patindex like function which will compare two columns in one table or two different tables..

tkizer
Almighty SQL Goddess

USA
37143 Posts

Posted - 04/23/2008 :  19:12:45  Show Profile  Visit tkizer's Homepage  Reply with Quote
If the tables can be joined together, then patindex can still be used.

Otherwise, please provide a data example.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

chandan_joshi80
Starting Member

India
30 Posts

Posted - 04/24/2008 :  01:16:26  Show Profile  Reply with Quote
IN SQL SERVER PATINDEX USED TO FIND THE POSITION OF A CHARACTER IN A STRING.

SELECT * FROM TEMPTABLE2 T WHERE EXISTS (SELECT COL2 FROM TEMPTABLE2
WHERE COL2=T.COL2)
THIS TYPE OF SQL STATEMENT ALSO COMPARING TWO COLUMNS VALUES.

chandan Joshi
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52323 Posts

Posted - 04/24/2008 :  01:21:11  Show Profile  Reply with Quote
Post your full requirement with some sample data.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000