Use the Mssql_init statement to initialize the stored procedure, then call the Mssql_bind statement to specify the stored procedure parameters, and finally call Mssql_execute to execute the stored procedure.
PHP Tutorial calls MSSQL stored procedure instance application
Use the Mssql_init statement to initialize the stored procedure, then call the Mssql_bind statement to specify the stored procedure parameters, and finally call Mssql_execute to execute the stored procedure.
*/
Connect MSSQL Database Tutorial Server
$link = Mssql_connect ("127.0.0.1", "sa", "sa") or Die ("Can ' t connect SQL Server");
mssql_select_db ("FRRC", $link) or Die ("Select database Failure");
Initialize and load the stored procedure Bigdatabase
$stmt = Mssql_init ("Bigdatabase", $link) or Die ("Initialize stored procedure failure");
Mssql_bind ($stmt, "@pagesize", $pagesize, SQLINT4);
Mssql_bind ($stmt, "@start", $start, SQLINT4);
@ $ms _result = Mssql_execute ($stmt, false);
Mssql_query ("DUMP TRANSACTION tempdb with no_log");
do{
while ($ms _rs = Mssql_fetch_object ($ms _result))
{
For data processing
}
}
Msssql stored procedures are bigdatabase as follows
/*
CREATE PROCEDURE Bigdatabase
@pagesize int,
@start int
As
declare @bsql nvarchar (4000)
Set @bsql = ' SELECT top ' + str (@pagesize) + ' Username,jobid,password,useremail,zcdata,ip,name,xingbie,minzu,xueli, Hunyin,age,xuexiao,zyclass,zhuanye,x_suozaidi,x_suozaidi1,huji,huji1,shengao,byear,birthyear,birthmonth, Birthday,dianhua,qq,gerenzhuye,selectedjob1,selectedjob2,selectedjob3,s_pwl1,s_pwl2,s_pwl3,daiyuyaoqiu, Negotiable,providehouseneeded,availopts,availnotice,llcs,convert (varchar (+), DLSJ,) as Dlsj,xgsj,dlcs, Jsjshuiping,language_one,l_oneability,language_two,l_twoability,mandarinlevel,skillkey,jingyan,photopb,photo, Phototre,mbsys,codetype,code,shouji,posts,address,jobtype,convert (varchar (8000), Pingjia) as Pingjia, convert ( varchar (8000), Jinengzhuanchang) as Jinengzhuanchang, convert (varchar (8000), Fazhanfangxiang) as Fazhanfangxiang, CONVERT (varchar (8000), other) as, and from the person where ID not in (select top ' + str (@start) + ' ID from the person order by I D ASC) Order by ID ASC '
Execute sp_executesql @bsql
GO
Note: text must be converted to varchar for processing, otherwise it will be problematic
This site original article reproduced annotated from www.bKjia.c0m China web first station
http://www.bkjia.com/PHPjc/630876.html www.bkjia.com true http://www.bkjia.com/PHPjc/630876.html techarticle use the Mssql_init statement to initialize the stored procedure, then call the Mssql_bind statement to specify the stored procedure parameters, and finally call Mssql_execute to execute the stored procedure. PHP Tutorial Call MSSQL stored procedure ...