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.
| Author |
Topic |
|
zubamark
Starting Member
23 Posts |
Posted - 2008-06-13 : 12:59:46
|
| Hello, I have table1 ID PATH1 .166.184.185.186.Need get data from table2 using PATH data from table1select * from table2 where id in (select Substring(replace(path,'.',','),2,Len(path)-2) from table1)ERROR:Syntax error converting the varchar value '166,184,185,186' to a column of data type int.Any solution please.Regard,M.Z. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-13 : 13:03:07
|
| May be this:-SELECT *FROM table2 t2INNER JOIN table1 t1ON t1.PATH LIKE '%.'+ CAST(t2.id as varchar(5)) + '.%' |
 |
|
|
zubamark
Starting Member
23 Posts |
Posted - 2008-06-13 : 13:26:48
|
| It works. Thanks |
 |
|
|
|
|
|