well, you could code a DTSpackage to do this, then exec an xp_cmdshell DTSRun of the package from a stored procedure ... but that's a buit of a kludge.maybe you can figure out a way with OPENDATASOURCE ... I don't know if it is capable of inserting data. Below is an example of code that select's from an excel spreadsheet. Good Luckif exists (select 1 from sysobjects where name = 'usp_Import_ExcelFile_TempTable' and xtype = 'p') drop procedure usp_Import_ExcelFile_TempTableset nocount ongocreate procedure usp_Import_ExcelFile_TempTable@filename varchar(250),@sheetname varchar(100) = 'Sheet1$',@succeed int OUTPUTasbeginset @succeed = -1 --failureset nocount onif exists (select 1 from sysobjects where name = 'excel_data_inserted' and xtype = 'u') drop table dbo.excel_data_inserteddeclare @sql varchar(500)declare @filexists intset @sql = 'SELECT * INTO dbo.excel_data_inserted FROM OpenDataSource( ''Microsoft.Jet.OLEDB.4.0'', ''Data Source="'+@filename+'";Extended properties=Excel 8.0'')...['+@sheetname+']'exec master..xp_fileexist @filename, @filexists OUTif (@filexists <> 1) print 'No file'else begin set @succeed = 0 --success-- print @succeed-- print @sql exec (@sql) endend
*##* *##* *##* *##* Chaos, Disorder and Panic ... my work is done here!