Re: Create Table not found in same Execute SQL -
08-19-2004
, 03:52 PM
I know there has to be a reason you are using a cursor over straight TSQL or
a DataPump. :-)
You should be able to create a table and then populate the table in the same
task. i.e.
CREATE TABLE DeleteMePlease(A int)
GO
INSERT DeleteMePlease(A) VALUES(1)
If you hit parse it will tell you that it has no idea about the table but it
works at execution time.
--
--
Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know
"Ron Sissons" <RSISSONS (AT) rcoe (DOT) k12.ca.us> wrote
I have an Execute SQL task that creates a table (if it doesn't exist) and
then i use a cursor to populate the table.
Problem is the insert fails because it says the table wasn't found. How is
that possible when it was just created in the statement above the insert?
Does the connection have to be refreshed, or do I need to create the table
in a separate task, then do the insert in another on success of the create
table?
Ron Sissons, DBA
Information Technology Services
Riverside County Office of Education
3939 Thirteenth Street, Riverside, CA 92502-0868
Telephone: (909) 826-6471; FAX: [909] 826-6451
----------------------------------------------------------------------------
----
I have an Execute SQL task that creates a table (if it doesn't exist) and
then i use a cursor to populate the table.
Problem is the insert fails because it says the table wasn't found. How is
that possible when it was just created in the statement above the insert?
Does the connection have to be refreshed, or do I need to create the table
in a separate task, then do the insert in another on success of the create
table?
Ron Sissons, DBA
Information Technology Services
Riverside County Office of Education
3939 Thirteenth Street, Riverside, CA 92502-0868
Telephone: (909) 826-6471; FAX: [909] 826-6451 |