h.schlais (11/26/2007)
......omitted stuffcast(Bal_No as integer) as Bal_No
from openquery(db032007,'select * from pr_input') pr_input
What's the entire of that statement? From what you posted, it looks like you're missing a select, but that might be part of the omitted stuff.
I'm guessing that's the declare cursor statement, but I can't be sure.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability