Import Excel data into SQL 2008 without subtotal and totals with Sql Server Studio -
Import Excel data into SQL 2008 without subtotal and totals with Sql Server Studio -
i want import excel 2007 info without sub totals , totals using sql server studio. tried importing straight comes along sub totals , totals too. there straight forwards way in doing this?
or there alternative way of doing import?
edit 1 added excel format
i not using query using sql wizard import. trying without scripts.
excel format
programid | name   |  amount 20        | adrian |     20 20        | jack   |     35            sub total     55  <== not want import 21        | janet  |     25 21        | jill   |     20            sub total     45  <== not want import             total        100  <== not want import        
if using openrowset can  add together clause query
select * openrowset('microsoft.ace.oledb.12.0',     'excel 12.0 xml;hdr=yes;database=path\to\the.xlsx',     'select * [sheet_name$] name not ''%total%'' , name <> ''''')    if need set providers etc. recommend reading this provides examples , alternative methods importing info excel.
using tasks -> import data; after setting source , destination, select "write query..." utilize similar query above such as
select * `sheet_name$` `name` not "%total%" , name <> ""    for reason using query messes info type mappings link. based on link added
<!-- varchar query kludge --> <dtm:datatypemapping >     <dtm:sourcedatatype>         <dtm:datatypename>200</dtm:datatypename>     </dtm:sourcedatatype>     <dtm:destinationdatatype>         <dtm:characterstringtype>             <dtm:datatypename>dt_str</dtm:datatypename>             <dtm:usesourcelength/>         </dtm:characterstringtype>     </dtm:destinationdatatype> </dtm:datatypemapping>  <!-- nvarchar query kludge --> <dtm:datatypemapping >     <dtm:sourcedatatype>         <dtm:datatypename>202</dtm:datatypename>     </dtm:sourcedatatype>     <dtm:destinationdatatype>         <dtm:characterstringtype>             <dtm:datatypename>dt_wstr</dtm:datatypename>             <dtm:usesourcelength/>         </dtm:characterstringtype>     </dtm:destinationdatatype> </dtm:datatypemapping>    to acetossis.xml seemed 'resolve' issue.
 sql excel-2007 
 
Comments
Post a Comment