I have the following view run to an external mssql database. I am connecting to the same database for some full stored procedures with input parameters and these work fine but the view doesnt work and gives the error
Warning: mssql_execute() [function.mssql-execute]: message: The request for procedure 'usv_Extended_Confirmation' failed because 'usv_Extended_Confirmation' is a view object. (severity 18) in
Warning: mssql_execute() [function.mssql-execute]: General SQL Server error: Check messages from the SQL Server (severity 18) in
Warning: mssql_execute() [function.mssql-execute]: stored procedure execution failed in
Warning: mssql_fetch_assoc() expects parameter 1 to be resource, boolean given in
The script calling the view is as follows
//run msdb connected view procedure
function runView($procedure){
global $msdb;
//initiate function
$proc = mssql_init('usv_Extended_Confirmation', $msdb);
//Execute Procedure
$result = mssql_execute($proc);
while ($row = mssql_fetch_assoc($result)){
$results[] = $row;
}
$return = $results;
//Free Memory
mssql_free_statement($proc);
return $return;
}
You don’t execute a view. A view is like table or a query – you
Selectfrom it.