• It worked after converted inline statments to stord proc. thanks for your help.