最近做Excel 导入导出Sql
//查询数据库,如果表存在则删除,否则创建
// string strSql = string.Format("if exists (select * from sysobjects where name ='" + SheetSet[3] + "')drop table " + SheetSet[3] + " else create table " + SheetSet[3] + "(", fileName);
//如果表存在,则输出存在,否则创建
string strSql = string.Format("if exists(select * from sysobjects where name = '" + SheetSet[3] + "')print '存在'if not exists(select * from sysobjects where name = '" + SheetSet[3] + "')create table " + SheetSet[3] + "(", fileName);
" + SheetSet[3] + " 这个是表名