output clause sqlsrv
Posted on 2010-09-17
I have a webpage i am working on that tracks absences. it uses a php page to input records into a mssql 2005 database. i use the sqlsrv driver as the go between.
what i need to do is use sqlsrv_query to run an insert statment which uses the output clause to return the id(autonumber) field. i have been searching for an hour and have not found this. there are plenty out there about using a stored procedure to return the output but i am not running a stored procedure, i am using sqlsrv_query to run a statment with an output clause.
i need to know if this can be done, and if it can, how would i acess the the returned id field.