| fetch next from read_cursor into @tbl,@fld end
close read_cursor deallocate read_cursor GO
set ANSI_NULLS ON GO set NOCOUNT off GO
select count(*) from #t drop table #t GO
select count(*)-1 from #tc
select * into ##tx from #tc order by tablename
drop table #tc
--select * from ##tx
declare @db nvarchar(60),@sql nvarchar(3000) set @db=db_name() --请修改用户名和口令 导出到Excel 中 set @sql='exec master.dbo.xp_cmdshell ''bcp ..dbo.##tx out c:\' @db '_exp.xls -w -C936 -Usa -Psa ''' print @sql exec(@sql) GO drop table ##tx GO-- ======================================================
--根据表中数据生成insert语句的存储过程
--建立存储过程,执行 spGenInsertSQL 表名
--感谢playyuer
-- ======================================================
create proc spGenInsertSQL (@tablename varchar(256)) as begin declare @sql varchar(8000) declare @sqlValues
|
| 共16页: 上一页 [1] [2] [3] [4] 5 [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] 下一页 |
评论加载中…