Php calls the Stored Procedure Code of mssql 2000.

Source: Internet
Author: User

Php calls the Stored Procedure Code of mssql 2000, which I made yesterday. Let's take a look at the code for calling the stored procedure of mssql using php.

$ 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 let's take a look at the stored procedure functions of the mssql data table.

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

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.