Question: I currently work for a company that services generators, and we've recently received a huge list of about 6000 new pieces of equipment, I've been asked to see if I can write a script to import the data into our web application's database, but I am still VERY new to the coding side of IT.

My current solution is to use an INSERT INTO query to pull the data into the production database, however my goal is to make this script as user friendly as possible, so they can use it even if I happen to move elsewhere. 

With that being said, my question would be how do I write a query to turn an "Asset Type" field (i.e. Generator, ATS) into a foreign key associated with that type (1001, 1002) and then insert it into the database? Is this possible, or will we have to convert the equipment into fks before running the script?

I did see a similar question about altering data, but unless I'm just misunderstanding the answer, that didn't seem to be what I'm looking for.

Answer: 
I would recommend on top of using a staging table as JohnHC has suggested but also using an SSIS package that they can then in the future just create a csv file, put it in a specific folder, and then a job that checks for the file every 15 minutes (or whatever you choose) will run the package when it finds anything with the specific name and format in that folder. Would make it so they dont even need to look at code but just need to populate a CSV file.
Use a staging table...

```
create table Stage1 (AssetId INT identity(1000,1) primary key, AssetInfo varchar(20), OtherFields...);

insert into Stage1 (AssetInfo, OtherFields)
select distinct AssetInfo, OtherFields
from ExistingAssetTable
;

```

Then you can use the now-generated keys to populate your other table