Encapsulte as SP - not converting variable to parameters

RichBev61RichBev61 Posts: 6
edited July 2, 2009 9:50AM in SQL Refactor Previous Versions
Here is the sproc code that is generated in the preview window:
CREATE PROCEDURE dbo.EncapsulatedProcedure AS
BEGIN
DECLARE @actno VARCHAR(19)
SET @actno = '1234'
SELECT  *
FROM    dbo.tblAccountOHD
WHERE   AccountNo = @actno
END

As you can see, a variable is declared, set and used, but stays a local variable. I've tried this on a number of different queries and the locals NEVER become params. What gives?

BTW, I've re-started SSMS 2005 and the results are the same.

Comments

  • I've had the same problem and since I haven't tried to use it that often I always assumed I was doing something wrong. It would be nice to know why it doesn't put the parameter in or what we have to do so that it will
  • Anu DAnu D Posts: 876 Silver 3
    Thnaks for your post and apologise that you have encountered this issue with SQL Refactor.

    I was able to replicate this issue at our end.

    I have raised this bug in our internal tracking system so that development team can look into it and incorporate in future release. Bug tracking number for that issue is SR-849.

    Kindly let me know if you have any other issues regarding SQL refactor, I'll like to help.
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: [email protected]
Sign In or Register to comment.