您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

调用使用链接服务器的mssql存储过程遇到的问题

2026/2/16 16:38:43发布17次查看
php调用使用链接服务器的mssql存储过程出错,哪位有遇过到类似的问题?
//省略其它语句
$queryp= exec oa_pfm_attend_group_toexempt @begin='$date1',@end='$date2';
$cursor = msexequery( $msconnection, $queryp );
//省略其它语句
//组合的$queryp是:exec oa_pfm_attend_group_toexempt @begin='2013-03-01',@end='2013-03-24'
存储过程在查询分析器执行没有问题,把所有使用链接服务器的语句删除后php调用也没有问题,是不是php调用的存储过程不能使用链接服务器?我写个asp试试有问题没[经过测试,存储过程在asp下执行也没有任何问]
php的出错信息无参考价值:
错误#0: 
sql语句: exec oa_pfm_attend_group_toexempt @begin='2013-03-01',@end='2013-03-24'
sqlserver事件跟踪和日志信息查不到有用的信息.
存储过程代码:
drop proc oa_pfm_attend_group_toexemptgocreate proc oa_pfm_attend_group_toexempt@begin datetime,@end datetimeasbegin set nocount on set ansi_warnings on set ansi_nulls on --declare @begin datetime --declare @end datetime --set @begin = @beginstr --set @end = @endstr create table #query_table_temp ( checkday datetime not null ,checkin datetime not null ,checkout datetime not null ,isholiday bit not null default 0 ) declare @checkday datetime declare @checkin datetime declare @checkout datetime set @checkday = @begin while (@checkday#query_table_temp.checkin and out1=0 and leave1=0 and rest=0 and evection=0) as 迟到人次 ,(select count(*) from #attend_temp where checkday=#query_table_temp.checkday and checkout<#query_table_temp.checkout and out2=0 and leave2=0 and rest=0 and evection=0) as 早退人次 ,(select count(*) from #attend_temp where checkday=#query_table_temp.checkday and checkin is null and out1=0 and leave1=0 and rest=0 and evection=0) as 上班未登记人次 ,(select count(*) from #attend_temp where checkday=#query_table_temp.checkday and checkout is null and out2=0 and leave2=0 and rest=0 and evection=0) as 下班未登记人次 from #query_table_temp drop table #query_table_temp drop table #attend_temp set nocount offendgo
回复讨论(解决方案) msexequery 是 php 函数吗?
我怎么没见过
哦,真是奇了,原来是用mssql_query不行,改为odbc_exec没问题了.先用着odbc_exec先.
msexequery是包装的函数,原来用的是mssql_query.
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product