大家好!请问在用下面的SQL导入EXCEL数据至表T时,怎样使这一次导入EXCEL生成一从1开始递增的序号?
String sql="insert into T(a,b) " +
"select "+Product_Code+","+Product_Name+" from " +
"OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source=\""+path+"\";Extended " +
"Properties=Excel 5.0')..."+sheetnm+"$ where "+se+" is not null";
String sql="insert into T(a,b) " +
"select "+Product_Code+","+Product_Name+" from " +
"OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source=\""+path+"\";Extended " +
"Properties=Excel 5.0')..."+sheetnm+"$ where "+se+" is not null";
"select "+Product_Code+","+Product_Name+" from " +
"OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source=\""+path+"\";Extended " +
"Properties=Excel 5.0')..."+sheetnm+"$ where "+se+" is not null";表中加个IDENTITY列?
alter table tb add id int identity(1,1)