SQL SERVER使用ODBC 驱动建立的链接服务器调用存储过程时参数不能为NULL值
2016-01-10 00:47
471 查看
我们知道SQL SERVER建立链接服务器(Linked Server)可以选择的驱动程序非常多,最近发现使用ODBC 的 Microsoft OLE DB 驱动程序建立的链接服务器(Linked Server), 调用存储过程过程时,参数不能为NULL值。
![](http://images2015.cnblogs.com/blog/73542/201601/73542-20160110004615637-968222189.png)
否则就会报下面错误提示: 对应的英文错误提示为: EXEC xxx.xxx.dbo.Usp_Test NULL,NULL,'ALL' Msg 7213, Level 16, State 1, Line 1 The attempt by the provider to pass remote stored procedure parameters to remote server 'xxx' failed. Verify that the number of parameters, the order, and the values passed are correct. 对应的中文错误提示为: EXEC xxx.xxx.dbo.Usp_Test NULL,NULL,'ALL' Msg 7213, Level 16, State 1, Line 1 提供程序将远程存储过程参数传递给远程服务器 'xxx' 的尝试失败。请确保参数的数目、顺序和所传递的值正确。 EXEC xxx.xxx.dbo.Usp_Test '','','ALL' 或者给参数赋予一个合适的值则不会报任何错误。另外使用Microsoft OLE DB Provider for SQL Server驱动方式建立的链接服务器(Linked Server)调用存储过程时参数就可以为NULL。
![](http://images2015.cnblogs.com/blog/73542/201601/73542-20160110004615637-968222189.png)
否则就会报下面错误提示: 对应的英文错误提示为: EXEC xxx.xxx.dbo.Usp_Test NULL,NULL,'ALL' Msg 7213, Level 16, State 1, Line 1 The attempt by the provider to pass remote stored procedure parameters to remote server 'xxx' failed. Verify that the number of parameters, the order, and the values passed are correct. 对应的中文错误提示为: EXEC xxx.xxx.dbo.Usp_Test NULL,NULL,'ALL' Msg 7213, Level 16, State 1, Line 1 提供程序将远程存储过程参数传递给远程服务器 'xxx' 的尝试失败。请确保参数的数目、顺序和所传递的值正确。 EXEC xxx.xxx.dbo.Usp_Test '','','ALL' 或者给参数赋予一个合适的值则不会报任何错误。另外使用Microsoft OLE DB Provider for SQL Server驱动方式建立的链接服务器(Linked Server)调用存储过程时参数就可以为NULL。
相关文章推荐
- Redis
- 数据库优化方案
- SQL SERVER使用ODBC 驱动建立的链接服务器调用存储过程时参数不能为NULL值
- 十分钟掌握SQLite操作
- Centos下安装Mongodb和php-mongodb扩展
- mysql执行导入sql出错
- oracle中设置表中主键字段自增
- MySQL百万级数据库优化方案
- 【mysql】使用tpcc-mysql进行压力测试
- sql两道题
- 动态增加数据库表字段
- MySQL高级八——触发器的使用
- Oracle版本–EBS R12.1.1
- memcached搭建缓存系统
- redis第一天
- 邮件系统服务器搭建记录(四)(Postfix+Cyrus-sasl+Courier-authlib+Dovecot+ExtMail+MySQL)
- ubuntu 14.04 安装mysql server的分支MariaDB Server初级教程
- memcache 之cas理解
- oracle行锁 select for update
- windows 下 Mysql免安装版(绿色版)配置