Design for importing definition data from Excel into SQL Server -


we have restaurant inventory control system uses sql server 2008 r2.

it takes long time add definition data: stock items, yields, packsizes, recipes, categories etc. so, our clients have asked if can upload excel.

before jump in , start, want find out if there best practice way this.

i know tools: ssis, stored procedures etc. i'm looking advice/resources can design process. how best setup spreadsheet, validate data, create child/parent relationships etc.

this must common project -- must have standard design/approach , that's i'm looking for.

i think design depend on technologies you're comfortable with. if you're comfortable ssis , stored procedures, general pattern use:

  1. excel template - wouldn't spend time on this, add headers , sheets necessary tables. can lock down things and/or implement rules, of validation done in stored procs.
  2. ssis - have package loads excel data staging tables, have rows errors added error log presented user along validation issues stored procedures.
  3. staging tables - have 1 staging table per sheet/production table, have executionid column in each staging table allow parallel processing. allow columns null can data in staging tables or set proper null conditions , have ssis redirect these rows on error. don't have primary key / foreign key relationships in staging tables, these can validated in stored procedure
  4. stored procedures - validate staging data, issues found added error log presented user or person performing import. if there no issues, import data production tables. if there existing data in production tables, comparison , update if applicable.

Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -