Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401

    Unanswered: OpenDataSource Problem

    Code:
    begin
    			select 	@datasource = 'Data Source="c:/'
    				+@FOLDERNAME
    				+'/'
    				+@FILENAME
    				+'";User ID=;Password=;Extended properties=Excel 5.0'
    			select 
    				* 
    			into 
    				#excel_table 
    			from OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',  @DATASOURCE)...sheet1$
    		end
    need to do this ... but using variables in opendatasource not allowed.

    so how do we go about it

    What i need to do is allow upload of any excel file ... may contain errors and then perform some checks on the data before putting it into another table with a fixed structure.
    Last edited by Enigma; 01-23-04 at 03:09.
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  2. #2
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    Code:
    select @query ='create procedure sp_excel_upload as select 
    				* 
    			into 
    				excel_table 
    			from OpenDataSource( '+''''+'Microsoft.Jet.OLEDB.4.0'+''''+','+''''+'Data Source="'
    				+@FOLDERNAME
    				+@FILENAME
    				+'";User ID=;Password=;Extended properties=Excel 5.0'+'''' + ')...sheet1$'
    			exec (@query)
    			exec sp_excel_upload
    		                /* put checks here */
                                                   	select * into final_table from excel_table
    			drop procedure sp_excel_upload
    			drop table excel_table
    How much performance overhead would this approach add on say about 40 files daily ???

    Any ideas ??
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  3. #3
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    Guys .. Gurus ....

    Nobody has any thoughts about this ??
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •