SyntaxFix
Write A Post
Hire A Developer
Questions
I resolved this problem writing function instead of procedure and using CROSS APPLY in SQL statement. This solution works on SQL 2005 and later versions.