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
SELECT *****some way to populate the identity field would go here
SLH0630 / SLH0090 .....
WHERE SLH0090 > 0 AND SLH0040 >= 2014 AND SLH0110 = 'Y'
ORDER BY SLH0040 DESC
I temporarily solved the problem. I recreated the SALES table and set all fields as type text except for RECNUM, which I gave type long integer so I could use that field to populate the OBJECTID. This isn't a great solution, but the linked server object (AS400) automatically assigns the string type to all columns. If I can determine a way to convert the 400 data to the correct types, I will post the solution.