Binding Error

  • 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

  • p.s.

    the code is running inside a stored procedure

  • 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 🙂

  • Didn't work apparently 🙁

  • 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