Search code examples
sql-serverssisetlsql-server-data-toolsssis-2017

No column information was returned by the SQL command. SSDT


I'm attempting to create an update query in SSDT. I'm getting

Unable to parse query text.

The query is:

UPDATE CustOrderWithDisp
SET YARDS = CustOrderWithDisp.QUANTITY * Lkp_TestCodes.[Test_GALS] * 0.00495113
FROM CustOrderWithDisp
INNER JOIN Lkp_TestCodes
ON CustOrderWithDisp.TEST_CODE = Lkp_TestCodes.[SVC CODE]

But if I actually run the query, it works.

I want to use this query in an SSIS package. When I put this query in an OLEDB Source, i get...

The component reported the following warnings:

Error at qry03_CalculateYards [OLE DB Source [33]]: No column information was returned by the SQL command.

I'm a novice at this, so be gentle. Your help is greatly appreciated!


Solution

  • Error at qry03_CalculateYards [OLE DB Source [33]]: No column information was returned by the SQL command.

    You are receiving this message because OLEDB Source is a DataFlow Task component, it is used to read data from an Table or SQL Command through an OLEDB Connection.

    The OLE DB source extracts data from a variety of OLE DB-compliant relational databases by using a database table, a view, or an SQL command. For example, the OLE DB source can extract data from tables in Microsoft Office Access or SQL Server databases.

    You don't have to put this query in an OLEDB Source, you have to use an Execute SQL Task and write this query in the SQL Command property.

    For UPDATE queries you have to use Execute SQL Task (in the Control Flow level, no in the DataFlow)

    The Execute SQL task runs SQL statements or stored procedures from a package. The task can contain either a single SQL statement or multiple SQL statements that run sequentially.

    References