Not sure what "next day I reviewed and got the same problem" means.
"Reviewing" does not mean "fixing".
This script has several issues.
First, please remove the comma after:
VARCHAR OpenMode = 'read',
as already suggested.
Next, you need to provide the number of instances for the operators.
All you provided was "[]" in the APPLY and SELECT statements.
Not sure what "next day I reviewed and got the same problem" means.
"Reviewing" does not mean "fixing".
This script has several issues.
First, please remove the comma after:
VARCHAR OpenMode = 'read',
as already suggested.
Next, you need to provide the number of instances for the operators.
All you provided was "[]" in the APPLY and SELECT statements.