PreacherUK
Technical User
I have a series of statements/code that runs with no problems in QA, using the word 'GO' inbetween each statement. The same series of statements/code requires me to remove all but the last 'GO' from the code. This is causing me problems.
Please, anyone, correct me if I'm wrong, but a QA window does not pre-compile or in anyway check ahead in your code/statements to check things?. In an sp SQL does attempt to pre-compile it?
I have made use of a couple of views in my process that rely upon tables created by statements previously in the process. If the table does not exist until a point after the sp is running then I get 'binding errors'. If I create the table before I run the sp it then allows me to save the sp as there is now an object for the view to be based on.
How do I allow for this short of leaving the data tables as permanent objects rather than truncating, dropping, and then re-creating them fresh each run of the sp?
FLOW:
sp start ---> truncate and drop tables ---> tables created throughout sp ---> views on those tables used to update other tables ---> end
Thanks
Please, anyone, correct me if I'm wrong, but a QA window does not pre-compile or in anyway check ahead in your code/statements to check things?. In an sp SQL does attempt to pre-compile it?
I have made use of a couple of views in my process that rely upon tables created by statements previously in the process. If the table does not exist until a point after the sp is running then I get 'binding errors'. If I create the table before I run the sp it then allows me to save the sp as there is now an object for the view to be based on.
How do I allow for this short of leaving the data tables as permanent objects rather than truncating, dropping, and then re-creating them fresh each run of the sp?
FLOW:
sp start ---> truncate and drop tables ---> tables created throughout sp ---> views on those tables used to update other tables ---> end
Thanks