现在公布,在网页中导入Excel数据到sql server,用语句导入的方法:
第一种:INSERT OPENDATASOURCE ('SQLOLEDB', 'Data Source=192.168.168.200;User ID=sa;Password=sa' ).ipwry.dbo.ipinto (intoip1,intoip2) SELECT [0#0#0#0], [0#255#255#255] FROM OPENDATASOURCE ('Microsoft.Jet.OLEDB.4.0', 'Data Source="e:\IP.xls";User ID=Admin;Password=;Extended properties=Excel 5.0' )...[sheet1$]
第二种:INSERT INTO IPINTO(intoip1, intoip2) SELECT [0#0#0#0], [0#255#255#255] FROM OPENDATASOURCE ('Microsoft.Jet.OLEDB.4.0','Data Source=e:\IP.xls;User ID=Admin;Password=;Extended properties=Excel 5.0' )...[sheet1$]Rowset_1