• sqlnaive (1/25/2013)

    What exactly are you checking from query analyzer ? Running the procedure with parameters or the code inside the procedure ?

    I tried both. Running the procedure with parameters (exec sp_name 'yyyy-mm-dd','xxxxxx') result in slow execution, executing the code itself (declare @P1 datetime, @P2 varchar(10) set @P1='yyyy-mm-dd' set @P2='xxxxxx' select ... etc) give immediate results.

    sqlnaive (1/25/2013)

    If the code inside the procedure is running perfectly and procedure not, then try recompiling the procedure and check the result.

    I tried to run exec sp_name 'yyyy-mm-dd','xxxxxx' with recompile (after I dropped the s/p and re-create it, to be sure) but unfortunately still no improvements 🙁

    ___________________________________________________________________
    Is better shut up and look stupid than open your mouth and eliminate any doubt