Insert data into table

I'm drawing a blank and need some help.  I need to populate the t_custom_ask_amounts table with data from a spreadsheet.  I think there is a much easier way besides an insert script one row at a time.  I just can't remember what I did last season to populate the table.  Can someone give me a quick and easy way to get my spreadsheet data into the table???

Teresa

Parents
  • Former Member
    Former Member $organization

    Hi Teresa

    What I would do is:

    1. Use the Import Data tool in SQLS Management Studio to import your spreadsheet into a local table. ( I actually have a "staging" db set up to hold temp import data like this, to try to keep impresario a bit tidier)
    2. use the INSERT INTO / SELECT syntax to copy from the temp table into t_custom_ask_amounts, like this:
    INSERT INTO impresario.dbo. t_custom_ask_amounts ([customer_no],[season_no],[type],[amount])
           SELECT [customer_no],[season_no],[type],[amount])
           FROM staging.dbo.LT_teresas _import_table
    or something like that
    Ken
    
    
Reply
  • Former Member
    Former Member $organization

    Hi Teresa

    What I would do is:

    1. Use the Import Data tool in SQLS Management Studio to import your spreadsheet into a local table. ( I actually have a "staging" db set up to hold temp import data like this, to try to keep impresario a bit tidier)
    2. use the INSERT INTO / SELECT syntax to copy from the temp table into t_custom_ask_amounts, like this:
    INSERT INTO impresario.dbo. t_custom_ask_amounts ([customer_no],[season_no],[type],[amount])
           SELECT [customer_no],[season_no],[type],[amount])
           FROM staging.dbo.LT_teresas _import_table
    or something like that
    Ken
    
    
Children
No Data