ODBC guide

Bulk update sheet rows using SQL Server data


Bulk updates rows in a sheet by reading data from an external SQL Server database using the SOURCE clause. The source query must include the Id of the rows to update.

UPDATE [My Sheet] 
SOURCE(   'MSSQL'--OR 'ODBC'--OR 'OLEDB'
        , 'Data Source=localhost;Initial Catalog=tempdb;Integrated Security=true'
		--OR for ODBC
		--,'DSN=MyOdbcDsn'
		--OR (DSN less connection)
		--,'Driver={Some ODBC Driver};uid=xxx;pwd=xxx;prop1=xxx;prop2=xxx....'
        , 'SELECT 4081850437570436 as Id,''2012-12-31'' [Some Date Column],''true'' [Some CheckBox Column],''Good example'' [Some Text Column]
           UNION
		   SELECT 8585450064940932 as Id,''2012-10-01'' [Some Date Column],''true'' [Some CheckBox Column],''Good example'' [Some Text Column]')
--WITH(AllowPartialSuccess='true',output=1)