I have been asked to update a column with some values saved in a spread sheet.
I have been asked to update a column with some values saved in a spread sheet. I am not sure which SSIS Tasks i should use for this. Thanks.Mr Shaw
November 19th, 2010 8:43am

Hello Shaw, Create an OLEDB Connection to your Excel, After that drag Execute SQL TASK and then you can update any cell same like you update table. E.g. Lets say your Sheet1 has ID and Name Columns, and you want to update Name for ID=1 Update [Sheet1$] Set Name="TEST" WHERE ID=1 Thanks
Free Windows Admin Tool Kit Click here and download it now
November 19th, 2010 9:21am

Sorry... I need to update a SQL Server table with the values in the Excel SpreadSheet.Mr Shaw
November 19th, 2010 9:24am

@Amir : This works fine, what if column has dynamic name and one more thing, will excel supports space in sheet name? Let me know Thanks BB
Free Windows Admin Tool Kit Click here and download it now
November 19th, 2010 9:24am

Here are the steps Shaw, 1-Create OLEDB Connection to Excel 2-Create a variable of String type (Name) , lets say you want to select Name Value from Excel 3-Drag Execute SQL task, Write this Query Select Name from [Sheet1$] Where ID=2 , In result Set , Select Single Row and go to Result Set and then Add Name variable. ResultName=0 and Result Variable User::Name 4--Drag another Execute SQL Task and then Write this Query Insert into dbo.MYTABLE (Name) VALUES(?) Then go to Parameter mapping and add Name as input Variable. Here are some links , how to use Execute SQL TASK http://www.sqlis.com/post/The-Execute-SQL-Task.aspx http://technet.microsoft.com/en-us/library/ms140355.aspx Thanks
November 19th, 2010 9:39am

Hello BeginnerBachi, Yes, it will work if SheetName has space in that , e.g. Select Name from [My Sheet$] Where ID=2 --Create Excel Connection to your Excel Without First Row has Column Names, This way your columns will be start like F1..... use execute SQL TASK and your query will be Select F2 from [My Sheet$] Where F1=2 See I am extract value from Second column where First Column=2 Thanks
Free Windows Admin Tool Kit Click here and download it now
November 19th, 2010 10:30am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics