Your procedure looks fine. Are you able to run the stored procedure from Query Anayzer?
http://databaseandstorage.blogspot.com http://gotodba.weebly.com
Forum Rules