SQL数据中运行cmd命令
在sql查询分析器里面是不能直接运行cmd命令的
但是SQL给出了一个接口
--打开高级设置
EXEC sp_configure 'show advanced options', 1
RECONFIGURE
--打开xp_cmdshell扩展存储过程
EXEC sp_configure 'xp_cmdshell', 1
RECONFIGURE
首先 打开一些配置
然后执行你要运行cmd命令
exec master..xp_cmdshell 'net start "computer browser"'
RECONFIGURE
--添加网络驱动器映射
exec master..xp_cmdshell 'net use z: \\192.168.0.3\F$\DataBase "密码" /user:192.168.0.3(IP)\administrator(登陆用户名)
然后关闭相应的程序
--删除映射
exec master..xp_cmdshell 'net use z: /delete'
--关闭xp_cmdshell扩展存储过程、高级设置
EXEC sp_configure 'xp_cmdshell', 0
RECONFIGURE
EXEC sp_configure 'show advanced options', 0
RECONFIGURE
相关文档:
select语句中只能使用sql函数对字段进行操作(链接sql server),
select 字段1 from 表1 where 字段1.IndexOf("云")=1;
这条语句不对的原因是indexof()函数不是sql函数,改成sql对应的函数就可以了。
left()是sql函数。
select 字段1 from 表1 where charindex('云',字段1)=1; 字符串函数对二进制数据、字符串和 ......
【1】
create procedure proc_pager1
( @pageIndex int, -- 要选择第X页的数据
@pageSize int -- 每页显示记录数
)
AS
BEGIN
declare @sqlStr varchar(500)
set @sqlStr='select top '+con ......
/***************************************************
作者:herowang(让你望见影子的墙)
日期:2010.1.5
注: 转载请保留此信息
......
Microsoft Access 数据类型
数据类型
描述
存储
Text
用于文本或文本与数字的组合。最多 255 个字符。
Memo
Memo 用于更大数量的文本。最多存储 65,536 个字符。
注释:无法对 memo 字段进行排序。不过它们是可搜索的。
Byte
允许 0 到 255 的数字。
1 字节
Integer
允许介于 -32,768 到 32 ......