在SQL 脚本中进行 文件的读写
2013-04-23 19:59
169 查看
首先需要开启xp_cmdshell
然后再SQL中插入:
或
sp_configure 'show advanced options',1 reconfigure go sp_configure 'xp_cmdshell',1 reconfigure go
然后再SQL中插入:
Declare @Path varchar(5000) Set @Path='E:\Test.txt' declare @Command varchar(5000) set @Command='echo "Hello World Rex">' + @Path exec master..xp_cmdshell @Command
或
Declare @Path varchar(5000) Set @Path='E:\Test.txt' declare @Command varchar(5000) set @Command='echo "'+@MyVarible+'">' + @Path exec master..xp_cmdshell @Command
相关文章推荐
- 在SQL 脚本中进行 文件的读写
- 在SQL脚本中进行文件的读写
- Oracle Sql脚本进行硬盘写文件操作!
- 读写SQL脚本进行创建表、视图和存储过程
- Oracle PL/SQL Developer集成TFS进行团队脚本文件版本管理
- Java使用jxl对excel文件进行简单的读写
- 读写文件、文件方法、python2的乱码问题、python对passwd文件进行排序
- java程序执行SQL脚本文件
- 文件逐行读取并进行相关处理的Unix Shell 脚本
- PHP处理SQL脚本文件导入到MySQL的代码实例
- 用C语言进行BMP文件的读写
- mysql必知必会,使用命令行创建数据源,执行create.sql脚本文件,用populate.sql文件填充各个新表
- Shell脚本对文件中的行、单词、字符进行迭代输出示例
- java调用sqlplus执行批量脚本获得输出结果和调用.bat文件
- MySQL执行外部sql脚本文件的命令
- Android创建隐藏文件或者文件夹,并对其读写操作android创建隐藏文件或者文件夹,其实只要在文件名或者文件夹名字前加一个点号即可。 隐藏文件(夹)可直接进行读写。 下面是一段隐藏文件的创建
- 用C语言对txt文件进行读写处理的过程
- SQLSERVER SQL执行大脚本文件时,提示“内存不足”的解决办法
- Windows下MySQL批量执行SQL脚本文件
- C#进行文件读写、创建、复制、移动、删除的方法