Link to home
Start Free TrialLog in
Avatar of biotec
biotec

asked on

SSIS getting invalid object error when running basic t-sql tasks

I have a query that runs fine in SQL but not in SSIS. I get the following error:
 "Invalid object name 'GPRA_Totals'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

This is the first step it tries to handle,
insert into GPRA_Totals(DateLoaded)VALUES
(CONVERT(VARCHAR(50),GETDATE(),101))

Avatar of aaronakin
aaronakin
Flag of United States of America image

biotec,

Make sure that the GPRA_Totals table actually exists in the database you are connecting to, or if you are creating the table in the SSIS package, you can open the properties of the SQL task and set the BypassPrepare flag to True.
Avatar of chapmandew
post your query.
Avatar of biotec
biotec

ASKER

The table does exist. This is the first part of the query:
insert into GPRA_Totals(DateLoaded)VALUES
(CONVERT(VARCHAR(50),GETDATE(),101))
Next it just tries to do an update:
UPDATE GPRA_Totals
  SET UserPop = (SELECT COUNT(*) FROM vw_GPRA_UserPopulationDenominator)
  WHERE DateLoaded = CONVERT(VARCHAR(50),GETDATE(),101)
Avatar of biotec

ASKER

I do not have any data flow tasks in my SSIS package as I'm not sure I need them in there.
If you go to Management Studio, can you run the following query in your database? SELECT * FROM GPRA_Totals

If that doesn't work, you probably need to create the table.  If that does work, then go back into your SSIS package and make sure the connection manager that your task is using is pointing to the correct server and database.
No, you don't need a data flow task if you are using a SQL task.
Avatar of biotec

ASKER

Did all that and it all works and is set up correctly.
ASKER CERTIFIED SOLUTION
Avatar of chapmandew
chapmandew
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of biotec

ASKER

Now I get:

[Execute SQL Task] Error: Executing the query "insert into ngprod.dbo..GPRA_Totals(DateLoaded)VALUES (CONVERT(VARCHAR(50),GETDATE(),101)) " failed with the following error: "Could not find server 'ngprod' in sysservers. Execute sp_addlinkedserver to add the server to sysservers.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
post your query
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ahhh...good catch.  totally missed that one.