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 |
sqllearner
Aged Yak Warrior
639 Posts |
Posted - 2006-11-02 : 16:57:13
|
[code] DECLARE @sys_value VARCHAR(200)SET @sys_value= '1;45;56;657;67;67;78'DECLARE @create_user_id INTSET @create_user_id = 56SET @sys_value = REPLACE(@sys_value,';',',')PRINT @sys_valueIF CONVERT(varchar,@create_user_id) IN (@sys_value) BEGIN RETURN 1 ENDELSE RETURN 0[/code]Iam trying to return 1 or 0 based on the if condition.Though @create_user_id is available in the @sys_value its not giving the correct return value.Please help me with the query. |
|
sqllearner
Aged Yak Warrior
639 Posts |
Posted - 2006-11-02 : 17:31:00
|
Please help me with this query |
 |
|
jhocutt
Constraint Violating Yak Guru
385 Posts |
Posted - 2006-11-02 : 18:02:18
|
DECLARE @sys_value VARCHAR(200)SET @sys_value= '1;45;56;657;67;67;78'DECLARE @create_user_id INTSET @create_user_id = 56IF @sys_value like '%;'+cast(@create_user_id as varchar)+';%' BEGIN RETURN 1 ENDELSE RETURN 0"God does not play dice" -- Albert Einstein"Not only does God play dice, but he sometimes throws them where they cannot be seen." -- Stephen Hawking |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|