>>Are you ahve multiple batches (separated by GO) in the script? DECLARE is scopped to a batch.
>
>Yes, there are a lot of GO. What would be the specific guidelines on how to use GO in such a case?
May be you don't need GO at all if this is one script?
If it's not broken, fix it until it is.
My Blog