几段SQLServer语句和存储过程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语句的存储过程 上一篇:在SQLSERVER2005中实现素数计算 下一篇:SQLServer2005的一般部署步骤 更多相关文章
|
推荐文章
精彩文章
|