---the above code is not working for ObjectId like 1 and RevisionId =3 -- for ObjectId like 1 and RevisionId =3 it is select query is appending with where condition in revision 2
if @RevisionId in(2,3)
Begin -- 2
If @ObjectId like '%1%' OR @ObjectId like '%2%' and @RevisionId =2
Begin --3
If @ObjectId = '1'
Begin --4
Set @demoquery = @demoquery + @ColName + ' in (select id from table1 )'
End --4
else If @ObjectId = '2'
Begin --5
Set @demoquery = @demoquery + @ColName + ' in ( select id from table2 where status='''+ N'sample' +''' )'
End --5
End --3
else If @ObjectId like '%1%' OR @ObjectId like '%2%' and @RevisionId =3
Begin --3
If @ObjectId = '1'
Begin --4
Set @demoquery = @demoquery + @ColName + ' in (select id from table1 )'
End --4
End --3
else If @ObjectId = '2'
Begin --5
Set @demoquery = @demoquery + @ColName + ' in ( select id from table2 where status='''+ N'sample' +''' )'
End --5
End ---2
Aucun commentaire:
Enregistrer un commentaire