I am using a function listed below, several days ago it shows a error msg
function and recreate it, another error msg said there is a syntax error
But in another backup database, the same function works just fine.
Can anybody give your 2 cents on this?
Thanks a lot!
CREATE FUNCTION TF_GetHotProduct ()
Declare cur_BC CURSOR for select bc_id from bigCategory
-- for each BigCategory, select one latest new product
join SmallCategory SC on P.Smallclassid=SC.SC_id join MiddleCategory
join c_tek C on P.product_id = C.Product_id
C.Approved = 'Y'
order by P.CreateAt desc