Syntax
xp_cmdshell {'command_string'} [, no_output]Arguments
'command_string'Is the command string to execute at the operating-system command shell. command_string is varchar(255) or nvarchar(4000), with no default. command_string cannot contain more than one set of double quotation s. A single pair of quotation s is necessary if any spaces are present in the file paths or program names referenced by command_string. If you have trouble with embedded spaces, consider using FAT 8.3 file names as a workaround.no_outputIs an optional parameter executing the given command_string, and does not return any output to the client.Return Code Values
0 (success) or 1 (failure)Result Sets
Executing this xp_cmdshell statement returns a directory listing of the current directory.xp_cmdshell 'dir *.exe'
xp_cmdshell {'command_string'} [, no_output]Arguments
'command_string'Is the command string to execute at the operating-system command shell. command_string is varchar(255) or nvarchar(4000), with no default. command_string cannot contain more than one set of double quotation s. A single pair of quotation s is necessary if any spaces are present in the file paths or program names referenced by command_string. If you have trouble with embedded spaces, consider using FAT 8.3 file names as a workaround.no_outputIs an optional parameter executing the given command_string, and does not return any output to the client.Return Code Values
0 (success) or 1 (failure)Result Sets
Executing this xp_cmdshell statement returns a directory listing of the current directory.xp_cmdshell 'dir *.exe'
解决方案 »
- 比对结果
- SqlServer 2000用户自定义函数,varchar(4000)长度不够用怎么办?
- 请问这SQL语句错在哪里?
- sql server查询缓存点击率
- 关于SQL Server 2005 查询的排序的问题,请高手指点
- 关于变量@s=@s+name的奇怪现象,大家一起分析~~~
- 将数据库某个长字段按指定字符分成几个字段
- 就三十分了,一个很烦人的sql查询,想了二天了也没解决。请高手赐教!(附详细介绍)
- You restore the backup copies of the corrupted data files, which
- 关于数据库设计的问题,大家进来讨论一下.
- 重要数据需要恢复,如何操作了?
- 加密解密的问题
补充一点:
master..xp_cmdshell 'dir *.exe'