Home Forums SQL Server 2008 Working with Oracle Excel Pivot Table shows zeros from a SQL View hitting an Oracle View via a Linked Server RE: Excel Pivot Table shows zeros from a SQL View hitting an Oracle View via a Linked Server

  • I thought I would share the answer, although I am still left with questions.

    Someone on another forum suggested the following to get more insight into what is happening:

    select * into your_table from [dbo].[vwIMPACT_FEE_DATA]

    The table it created consisted of all nvarchar fields--no number fields.

    I also tried drilling into the pivot table to see the raw data. All of the number fields were left justified--an Excel indication of a text field.

    It appeared that SQL Server is unable to detect the Oracle data types from an Oracle view through the linked server. I added some casting to the SQL Server view to allow the Pivot table to see the data as Numbers:

    , CAST([Water Flow] AS Numeric) AS "Water Flow"

    I question why I would have to do this. Why can't SQL Server detect the data types in the Oracle view through the Linked Server?