Home > Database > Mysql Tutorial > body text

php 调用mssql 2000存储过程代码

WBOY
Release: 2016-06-07 17:46:49
Original
1070 people have browsed it

php 调用mssql 2000存储过程代码

php 调用mssql 2000存储过程代码这是我昨天做出来了哦,下面我们先看看利用php调用mssql的存储过程的代码吧

$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");

现在来看mssql数据表存储过程函数哦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
GO

本站原创转载注明

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!