if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#t') and type='U')
drop table #t
create table #t(outtext text)
insert into #t(outtext) exec master..xp_cmdshell 'dir C:\'
--exec master..xp_cmdshell 'bcp #t out c:\1.txt -c -U sa -P -S XBTDDWZ'
select * from #t阅读全文>
发表于 @ 2008年08月26日 15:13:00|评论(loading...)|编辑|收藏
(ms sql server)sql语句导入导出大全--详解
******* 导出到excel
exec master..xp_cmdshell ’bcp settledb.dbo.shanghu out c:\temp1.xls -c -q -s"gnetdata/gnetdata" -u"sa" -p""’/*********** 导入excelselect *
from opendatasource( ’microsoft.jet.oledb.4.0’,
’data source="c:\test.xls";user id=admin;password=;extended properties=excel 5.0’)...xactionsselect cast(cast(科目编号 as num阅读全文>
发表于 @ 2008年08月26日 11:35:00|评论(loading...)|编辑|收藏