AnsweredAssumed Answered

AS400 (linked server object) - Data to SQL Server GDB Table

Question asked by pbarnes on Feb 23, 2016
Latest reply on Feb 25, 2016 by pbarnes

I created a new table with schema. I want to INSERT data from the AS400 into my new GDB table. Here's the problem:

The OBJECTID field is an Identity field that auto-populates, so I do not include it in the Insert frunction. However, I receive an error when I run the query because it's "trying" to insert <Null> values into the OBJECTID field. Does anyone have experience trying to do this function, or something similar? Here's my query (cut down for easier viewing):

INSERT INTO [TaxMapping2015].[dbo].[SALES]

    (                                   ***[OBJECTID] would go here

      [RECNUM]

      ,[PPIN]

      ,[PARCEL_ID]

      ,[SOLDYY]

      ,[SOLDMM]

      ,[SOLDDD]

      ,[LANDPRICE]

      ,[IMPRPRICE]

      ,[TOTPRICE]

      ,...)

                                           

SELECT                                  *****some way to populate the identity field would go here

    SLH0025,

    SLH0020,

    SLH0025,

    SLH0040,

    SLH0050,

    SLH0060,

    SLH0070,

    SLH0080,

    SLH0090,

    SLH0630 / SLH0090 .....

 

 

FROM       APSALES.S1081FEB.APSALES.APDSLH01

WHERE SLH0090 > 0 AND SLH0040 >= 2014 AND SLH0110 = 'Y'

ORDER BY SLH0040 DESC

Outcomes