September 30, 2011 at 2:32 am
Hey there!
We have a simple bit of sql...
[font="Courier New"]table 1 & 2 don't exist
select * into table1 from view1
select * into table2 from view2[/font]
view2 uses table1.
The code fails after the first statement has run/second statement starts with a `binding error`, like table1 doesn't yet exist when the second statement runs and view2 doesn't work.
If we put a waitfor <x mins, x being longer than time it takes the first part to run> then the second statement runs ok.
Anyone any ideas?
Many thanks,
Martin
September 30, 2011 at 3:09 am
p.s.
the code is running inside a stored procedure
September 30, 2011 at 3:24 am
Ahh the person running this (I hate it when its a 3rd party your trying to help) says the waitfor in a SP doesn't help.
I've pointed them at sp_refreshview, fingers crossed 🙂
September 30, 2011 at 3:36 am
Didn't work apparently 🙁
September 30, 2011 at 4:07 am
Had the dev. replace select into with insert into + relevant changes to handle the tables, and all is good in the world.
I would still be interested to know why the select into scenario given above didn't work, if anyone knows?
Many thanks,
M.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply