PHP calls MSSQL 2000 stored procedure Code

Source: Internet
Author: User

PHP calls MSSQL 2000 stored procedure code that's what I did yesterday. Oh, let's take a look at the code that uses PHP to invoke the MSSQL stored procedure.

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

Now look at the MSSQL data table stored procedure function Oh bigdatabase

CREATE PROCEDURE Bigdatabase

@pagesize int,

@start int

As

declare @bsql nvarchar (4000)

Set @bsql = ' SELECT top ' + str (@pagesize) + ' username,from person where ID is not in (select top ' + str (@start) + ' ID from Person ORDER BY ID ASC) ORDER by ID ASC '

Execute sp_executesql @bsql

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.