Upload from Excel Spreadsheet

  • Hi

    I have been trying to upload data from a excel spreadsheet into a sql server table the spreadsheet has data like

    TableName    ColumnName

    -------------

     

  • Sorry my qoestion got posted before I could complete it

    In the spreadsheet in the first column there is some data say (table name) and in the second column there is the details about that (say column name) and in the first column value has been entered only once

    Example

    TableName ColumnNAme

    Authors   Authorid

                 AuthorName

                Address

    While uploading this data into sql server is there an easy way by which we can populate the value of column 1 for all the rows same as row 1 (like authors for all the rows and simlarly for all master/detail records from the spreadsheet)

    Thanks for the help in advance.

     

  • I can think of three different ways:

    1) run a script before loading to fill in the data.

    2) load the data into a staging table (probably one with an identity column), then do the insert via a stored proc.

    3) Using DTS, run the data pump via a VB script.  Save off table name (when it appears) into a global variable.  Use that value on rows where it doesn't appear.

  • Thanks Pam, I have done it for now using the temp_table/identity route. I will check the other options too to see if they are better.

     

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply