Rique Gresham wrote:

Hi All,

What I'm trying to do is query a mssql database using a SELECT statement to
get the last
report number from a table, increment that number by 1 and have it display
in a INPUT box.
The data will not INSERT into the database as a new record until one presses
the SUBMIT
button.

I believe @@IDENTITY holds the last auto-increment for MSSQL. You can use that to retrieve the last inserted record (assuming you have an auto-increment id field).


This should work "SELECT @@IDENTITY"

But I'm not a MSSQL guru or anything, so apologies if that doesn't work for you.

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
-----------------------
"Documentation is like sex: when it is good,
 it is very, very good; and when it is bad,
 it is better than nothing."

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to