package with stored procedure and excel data source

  • Hi

    I am a newbie and this is my first package and would like to know

    whether my project could be feasible in SQL 2005.

    I would like to use an excel file which stores the following

    data:

    customer last name, customer name and date of birth.

    A stored procedure should run on each record and compare

    the data between the spreadsheet and a table in SQL 2005.

    If the customer last name, customer name and the date of birth match

    then I would like to output all the results from sql to a new excel file.

    The table in SQL 2005 contains customer data as per below:

    customer id, customer name, customer last name, date of birth and address.

    Thank you in advance for any suggestions.

  • flat2f2 (12/22/2010)


    Hi

    I am a newbie and this is my first package and would like to know

    whether my project could be feasible in SQL 2005.

    I would like to use an excel file which stores the following

    data:

    customer last name, customer name and date of birth.

    A stored procedure should run on each record and compare

    the data between the spreadsheet and a table in SQL 2005.

    If the customer last name, customer name and the date of birth match

    then I would like to output all the results from sql to a new excel file.

    The table in SQL 2005 contains customer data as per below:

    customer id, customer name, customer last name, date of birth and address.

    Thank you in advance for any suggestions.

    No need for a stored proc - SSIS can do this for you in one hit using the two datasources (spreadsheet and table) and a merge join with Excel destination.

    Or, if you have a large dataset, I'd import your Excel data to a staging table and then do the match query in T-SQL, exporting the results to Excel.

    Is there another reason why you were thinking of using a stored proc for this?


  • thank you very much. The second option should work.

    Out of curiosity, I was wondering if the stored procedure could be run so it takes the parameters from the spreadsheet. As a result it loops through each customer in the spreadsheet and compares

    the details in the table.

    execute dbo.customer_search'Black','John','1987-07-14';

  • Yes - possible in a data flow task without too much bother - but sounds like it would be relatively slow in terms of performance as it's doing row-by-row processing.

    I'd much rather use SQL's power for set-based processing to do this.


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

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