--从查询分析器里面将查询到的记录插入到一个EXCEL表里面。
--f1,f2是Excel的标题
INSERT INTO OPENDATASOURCE('Microsoft.JET.OLEDB.4.0', 'Extended Properties=Excel 8.0;Data source=C:/aa.xls')...[sheet1$] (f1, f2)
select id,name from t_dw
查看SELECT花多少时间
declare @s datetime
set @s=getdate()
---
select * from tb1
---
select datediff(ms,@s,getdate())
print datediff(ms,@s,getdate())