Company Address IDs – Import

Did you know that within Purchase Order Processing that the list of available ship to addresses pulled from the Company Address ID setup within GP?  During a POP/Inventory/SOP implementation, it’s no uncommon for companies to have 100s of potential ship to addresses for purchases.  Below we’ve covered our favorite way to get this list of address IDs into the system using .csv/.txt files and SQL.

Step 1.)  Create a spreadsheet that list all address lines.  Our example contains the following columns.

Company ID, Address ID, Name, Contact, Address 1, City, State, Zip Code

Step 2.) Save spreadsheet to a tab-delimited text file

Step 3.) Open the text file & replace any ” characters w/ {blanks}.  ” characters will appear when a field contains a comma.

Step 4.) Import into SQL using SQL Server Management Studio

>>Right-Click Database

    >>Select Tasks

        >>Select Import Data

           >>Select Flat File as source

              >>Enter Staging Table Name in SQL Destination (Use name of CoAddressID_Template in our example below)

insert into
gpent..sy00600
(CMPANYID,LOCATNID,LOCATNNM,ADRSCODE,ADRCNTCT,ADDRESS1,ADDRESS2,ADDRESS3,CITY,COUNTY,STATE,ZIPCODE,COUNTRY,PHONE1,PHONE2,PHONE3,FAXNUMBR,CHANGEBY_I,CHANGEDATE_I,CCode)

select
@cmpanyid,left([Address
ID],15),left([Name],30),”,left([Contact],60),left([Address 1],60),”,”,left([City],25),”,left([State],30),left([ZIP Code],10),”,”,”,”,”,”,’1900-01-01 00:00:00.000′,” from coAddressid_template

That should do it.  You can add additional columns to your sourcefile if you please.  Just be sure to update your insert script to account for the new columns & remember character limitations! left(Address1,60)

Our first preference is to always use the Microsoft eConnect procedures or integration tools like Integration Manager when available.  However, when all else fails, a carefully executed SQL script can achieve the same outcome.  At the end of the day, it’s all data in a database.

Let us know if this works for you or if you’d like to see similar processes using SQL!

Share It
Share It
Tweet It
Picture of Kyle Malone, CPA
Kyle Malone, CPA

Dynamics GP Nut | GPUG All-Star 🏆 | Techo-Functional Consultant

Leave a Comment

Your email address will not be published. Required fields are marked *

30 Dynamics GP Tips & Tricks That You Cannot Live Without

Provide your email and we’ll send you our list of 30 things in GP that will have you feeling like

Send me 30 Tips & Tricks! (absolutely free)

Top-Tier Professional Consulting
Rates Lower Than The Others

Always non-billable introductory / discovery calls

$140 hour which includes ANY/ALL GP services:

  • GP Training
  • Module Implementation
  • Everyday Support
  • Report Development
  • Integration Development

We Want to See You Get Value From Your Investment In Dynamics GP!

Contact Us

ALaCarteGP, LLC | (740) 604-0099 | Madisonville, LA