Thanks for updating the file. Unfortunately I'm still having issues with the creation of the sp. I've copied and pasted the script and change the ALTER command to CREATE but get the following errors. (I'm executing this on a x64 version of SQL 2005).
Any ideas on how to fix this would be great.
Rudy
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near '?'.
Msg 102, Level 15, State 1, Line 16
Incorrect syntax near '?'.
Msg 102, Level 15, State 1, Line 17
Incorrect syntax near '?'.
Msg 137, Level 15, State 2, Line 17
Must declare the scalar variable "@DBName".
Msg 102, Level 15, State 1, Line 18
Incorrect syntax near '?'.
Msg 137, Level 15, State 2, Line 18
Must declare the scalar variable "@User".
Msg 102, Level 15, State 1, Line 20
Incorrect syntax near '?'.
Msg 137, Level 15, State 2, Line 20
Must declare the scalar variable "@DBName".
Msg 137, Level 15, State 2, Line 21
Must declare the scalar variable "@Action".
Msg 137, Level 15, State 2, Line 22
Must declare the scalar variable "@User".
Msg 137, Level 15, State 2, Line 24
Must declare the scalar variable "@DBName".
Msg 102, Level 15, State 1, Line 25
Incorrect syntax near '?'.
Msg 137, Level 15, State 2, Line 26
Must declare the scalar variable "@DBName".
Msg 137, Level 15, State 2, Line 29
Must declare the scalar variable "@DBName".
Msg 102, Level 15, State 1, Line 34
Incorrect syntax near '?'.
Msg 137, Level 15, State 2, Line 35
Must declare the scalar variable "@DBName".
Msg 102, Level 15, State 1, Line 37
Incorrect syntax near '?'.
Msg 137, Level 15, State 2, Line 38
Must declare the scalar variable "@Action".
Msg 137, Level 15, State 2, Line 40
Must declare the scalar variable "@Action".
Msg 137, Level 15, State 2, Line 43
Must declare the scalar variable "@Action".
Msg 102, Level 15, State 1, Line 50
Incorrect syntax near '?'.
Msg 137, Level 15, State 2, Line 51
Must declare the scalar variable "@err_flag".
Msg 102, Level 15, State 1, Line 81
Incorrect syntax near '?'.
Msg 137, Level 15, State 1, Line 92
Must declare the scalar variable "@ParmDefinition".
Msg 102, Level 15, State 1, Line 94
Incorrect syntax near '?'.
Msg 137, Level 15, State 2, Line 94
Must declare the scalar variable "@DBName".
Msg 102, Level 15, State 1, Line 97
Incorrect syntax near '?'.
Msg 102, Level 15, State 1, Line 100
Incorrect syntax near '?'.
Msg 102, Level 15, State 1, Line 105
Incorrect syntax near '?'.
Msg 102, Level 15, State 1, Line 108
Incorrect syntax near '?'.
Msg 102, Level 15, State 1, Line 112
Incorrect syntax near '?'.
Msg 102, Level 15, State 1, Line 114
Incorrect syntax near '?'.
Msg 102, Level 15, State 1, Line 116
Incorrect syntax near '?'.
Msg 137, Level 15, State 2, Line 116
Must declare the scalar variable "@Database".
Msg 102, Level 15, State 1, Line 119
Incorrect syntax near '?'.
Msg 137, Level 15, State 2, Line 119
Must declare the scalar variable "@Database".
Msg 137, Level 15, State 2, Line 120
Must declare the scalar variable "@Database".
Msg 137, Level 15, State 2, Line 121
Must declare the scalar variable "@DBReadOnly".
Msg 137, Level 15, State 2, Line 123
Must declare the scalar variable "@cmd".
Msg 137, Level 15, State 2, Line 124
Must declare the scalar variable "@Action".
Msg 137, Level 15, State 2, Line 124
Must declare the scalar variable "@cmd".
Msg 137, Level 15, State 2, Line 126
Must declare the scalar variable "@cmd".
Msg 137, Level 15, State 2, Line 127
Must declare the scalar variable "@cmd".
Msg 137, Level 15, State 2, Line 129
Must declare the scalar variable "@User".
Msg 102, Level 15, State 1, Line 132
Incorrect syntax near '?'.
Msg 102, Level 15, State 1, Line 136
Incorrect syntax near '?'.
Msg 102, Level 15, State 1, Line 141
Incorrect syntax near '?'.
Msg 102, Level 15, State 1, Line 145
Incorrect syntax near '?'.
Msg 102, Level 15, State 1, Line 149
Incorrect syntax near '?'.
Msg 102, Level 15, State 1, Line 151
Incorrect syntax near '?'.
Msg 102, Level 15, State 1, Line 152
Incorrect syntax near '?'.
Msg 102, Level 15, State 1, Line 153
Incorrect syntax near '?'.
Msg 102, Level 15, State 1, Line 155
Incorrect syntax near '?'.
Msg 137, Level 15, State 2, Line 155
Must declare the scalar variable "@name".
Msg 102, Level 15, State 1, Line 158
Incorrect syntax near '?'.
Msg 137, Level 15, State 2, Line 158
Must declare the scalar variable "@Action".
Msg 137, Level 15, State 2, Line 160
Must declare the scalar variable "@name".
Msg 137, Level 15, State 2, Line 161
Must declare the scalar variable "@name".
Msg 137, Level 15, State 2, Line 162
Must declare the scalar variable "@name".
Msg 137, Level 15, State 2, Line 164
Must declare the scalar variable "@Action".
Msg 137, Level 15, State 2, Line 166
Must declare the scalar variable "@name".
Msg 137, Level 15, State 2, Line 167
Must declare the scalar variable "@name".
Msg 137, Level 15, State 2, Line 169
Must declare the scalar variable "@Action".
Msg 137, Level 15, State 2, Line 171
Must declare the scalar variable "@name".
Msg 137, Level 15, State 1, Line 173
Must declare the scalar variable "@login_sid".
Msg 137, Level 15, State 2, Line 174
Must declare the scalar variable "@sid".
Msg 137, Level 15, State 2, Line 176
Must declare the scalar variable "@name".
Msg 137, Level 15, State 2, Line 177
Must declare the scalar variable "@SvrLevel".
Msg 102, Level 15, State 1, Line 180
Incorrect syntax near '?'.
Msg 137, Level 15, State 2, Line 181
Must declare the scalar variable "@cmd".
Msg 102, Level 15, State 1, Line 186
Incorrect syntax near '?'.
Msg 102, Level 15, State 1, Line 189
Incorrect syntax near '?'.
Msg 137, Level 15, State 2, Line 193
Must declare the scalar variable "@Action".
Msg 137, Level 15, State 2, Line 195
Must declare the scalar variable "@name".
Msg 137, Level 15, State 2, Line 197
Must declare the scalar variable "@name".
Msg 137, Level 15, State 2, Line 198
Must declare the scalar variable "@SvrLevel".
Msg 102, Level 15, State 1, Line 201
Incorrect syntax near '?'.
Msg 137, Level 15, State 2, Line 202
Must declare the scalar variable "@cmd".
Msg 102, Level 15, State 1, Line 207
Incorrect syntax near '?'.
Msg 102, Level 15, State 1, Line 210
Incorrect syntax near '?'.
Rudy