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 |
|
yaman
Posting Yak Master
213 Posts |
Posted - 2008-07-11 : 04:30:34
|
| Sir ,declare @str varchar(1000)Set @str='0,1'select * from tbl_application where isbpl in ( @str )How can i execute query ERROR :- Conversion failed when converting the varchar value '0,1' to data type bit.Yaman |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-07-11 : 04:37:19
|
| select * from tbl_application where ','+@a+',' like '%,'+cast( isbpl as varchar(10))+',%'More info herewww.sommarskog.se/dynamic_sql.htmlMadhivananFailing to plan is Planning to fail |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-07-11 : 05:35:45
|
quote: Originally posted by yaman Sir ,declare @str varchar(1000)Set @str='0,1'select * from tbl_application where isbpl in ( @str )How can i execute query ERROR :- Conversion failed when converting the varchar value '0,1' to data type bit.Yaman
What did you change in the question?MadhivananFailing to plan is Planning to fail |
 |
|
|
yaman
Posting Yak Master
213 Posts |
Posted - 2008-07-11 : 05:49:40
|
| Sir ,declare @str varchar(1000)Set @str='0,1'select * from tbl_application where isbpl in ( @str )How can i execute query ERROR :- Conversion failed when converting the varchar value '0,1' to data type bit.Actually column ISBPL IS BIT TYPE whenever i am putting @str in place of value , Query giving me error How can i execute query ... Putting @str At place of value Yaman |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-07-11 : 06:48:36
|
quote: Originally posted by yaman Sir ,declare @str varchar(1000)Set @str='0,1'select * from tbl_application where isbpl in ( @str )How can i execute query ERROR :- Conversion failed when converting the varchar value '0,1' to data type bit.Actually column ISBPL IS BIT TYPE whenever i am putting @str in place of value , Query giving me error How can i execute query ... Putting @str At place of value Yaman
Did you try the method I suggested?MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|