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 |
|
pelegk2
Aged Yak Warrior
723 Posts |
Posted - 2006-05-21 : 03:37:30
|
| i am doing a query on a tablewhere i have c column user_pid nvarchar(10).when i do a select like :select * from tbl1 where user_pid in (012345678,654123547)i recive an error that tells me that '000000000' cant be converted to data type int?!?!?!(i know that there is a user_pid= '000000000'but why does it make me prolbmes with the query?what can i do?thnaks i nadvancepelegIsrael -the best place to live in aftr heaven 9but no one wan't to go there so fast -:) |
|
|
Vinnie881
Master Smack Fu Yak Hacker
1231 Posts |
Posted - 2006-05-21 : 03:51:27
|
quote: Originally posted by pelegk2 i am doing a query on a tablewhere i have c column user_pid nvarchar(10).when i do a select like :select * from tbl1 where user_pid in (012345678,654123547)i recive an error that tells me that '000000000' cant be converted to data type int?!?!?!(i know that there is a user_pid= '000000000'but why does it make me prolbmes with the query?what can i do?thnaks i nadvancepelegIsrael -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)
Tryselect * from tbl1 where Cast(user_pid as int) in (012345678,654123547) |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-05-21 : 04:38:51
|
[code]select * from tbl1 where user_pid in ('012345678','654123547')[/code] KH |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-05-23 : 02:22:22
|
| >>select * from tbl1 where Cast(user_pid as int) in (012345678,654123547)That will lead to error if user_pid has alphabetsMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|