php 調(diào)用mssql 2000存儲(chǔ)過(guò)程代碼這是我昨天做出來(lái)了哦,下面我們先看看利用php調(diào)用mssql的存儲(chǔ)過(guò)程的代碼吧
$start = isset($_GET['start'])?$_GET['start']:0;
$end = isset($_GET['end'])?$_GET['end']:0;
$pagesize = isset($_GET['pagesize'])?$_GET['pagesize']:0;
$stmt = mssql_init("Bigdatabase", $link) or die("");
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");
現(xiàn)在來(lái)看mssql數(shù)據(jù)表存儲(chǔ)過(guò)程函數(shù)哦Bigdatabase
CREATE PROCEDURE Bigdatabase
@pagesize int,
@start int
AS
declare @bsql nvarchar(4000)
set @bsql = 'select top ' + str(@pagesize) + ' username,from person where id not in(select top ' + str(@start) + ' id from person order by id asc) order by id asc'
execute sp_executesql @bsql
更多信息請(qǐng)查看IT技術(shù)專欄