|
16 | 16 | $storedProc = sqlsrv_query($conn, $tsql); |
17 | 17 | if ($storedProc == false) { |
18 | 18 | echo "Error creating Stored Procedure"; |
19 | | - die(FormatErrors(sqlsrv_errors())); |
| 19 | + die(formatErrors(sqlsrv_errors())); |
20 | 20 | } |
21 | 21 | sqlsrv_free_stmt($storedProc); |
22 | 22 |
|
|
26 | 26 | // Error handling |
27 | 27 | if ($getProducts == false) { |
28 | 28 | echo "Error executing Stored Procedure"; |
29 | | - die(FormatErrors(sqlsrv_errors())); |
| 29 | + die(formatErrors(sqlsrv_errors())); |
30 | 30 | } |
31 | 31 | $productCount = 0; |
32 | 32 | $ctr = 0; |
|
49 | 49 | $storedProc = sqlsrv_query($conn, $tsql); |
50 | 50 | if ($storedProc == false) { |
51 | 51 | echo "Error dropping Stored Procedure"; |
52 | | - die(FormatErrors(sqlsrv_errors())); |
| 52 | + die(formatErrors(sqlsrv_errors())); |
53 | 53 | } |
54 | 54 | sqlsrv_free_stmt($storedProc); |
55 | 55 | ?> |
|
60 | 60 |
|
61 | 61 | if (sqlsrv_begin_transaction($conn) == false) { |
62 | 62 | echo "Error opening connection"; |
63 | | - die(FormatErrors(sqlsrv_errors())); |
| 63 | + die(formatErrors(sqlsrv_errors())); |
64 | 64 | } |
65 | 65 |
|
66 | 66 | /* Set up and execute the first query. */ |
|
101 | 101 | // Error handling |
102 | 102 | if ($getProducts == false) { |
103 | 103 | echo "Error deleting the UDF"; |
104 | | - die(FormatErrors(sqlsrv_errors())); |
| 104 | + die(formatErrors(sqlsrv_errors())); |
105 | 105 | } |
106 | 106 | $tsql1 = 'CREATE FUNCTION dbo.ifGetTotalItems (@OrderID INT) RETURNS TABLE WITH SCHEMABINDING AS RETURN ( |
107 | 107 | SELECT SUM(OrderQty) AS TotalItems FROM SalesLT.SalesOrderDetail |
|
112 | 112 | // Error handling |
113 | 113 | if ($getProducts == false) { |
114 | 114 | echo "Error creating the UDF"; |
115 | | - die(FormatErrors(sqlsrv_errors())); |
| 115 | + die(formatErrors(sqlsrv_errors())); |
116 | 116 | } |
117 | 117 | $tsql1 = "SELECT s.SalesOrderID, s.OrderDate, s.CustomerID, f.TotalItems |
118 | 118 | FROM SalesLT.SalesOrderHeader s |
|
122 | 122 | // Error handling |
123 | 123 | if ($getProducts == false) { |
124 | 124 | echo "Error executing the UDF"; |
125 | | - die(FormatErrors(sqlsrv_errors())); |
| 125 | + die(formatErrors(sqlsrv_errors())); |
126 | 126 | } |
127 | 127 | $productCount = 0; |
128 | 128 | $ctr = 0; |
|
0 commit comments