Encapsulte as SP - not converting variable to parameters

Refactors and formats SQL code.

Moderators: Chris Auckland, David Atkinson, Anu Deshpande, Luke Jefferson

Encapsulte as SP - not converting variable to parameters

Postby RichBev61 » Wed Jul 01, 2009 6:49 pm

Here is the sproc code that is generated in the preview window:

Code: Select all
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.
RichBev61
 
Posts: 4
Joined: Wed Jan 21, 2009 6:02 pm

Postby Giggles220 » Thu Jul 02, 2009 1:52 pm

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
Giggles220
 
Posts: 114
Joined: Thu Dec 07, 2006 9:06 pm
Location: Albany, NY

Postby Anu Deshpande » Thu Jul 02, 2009 2:50 pm

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: support@red-gate.com
Anu Deshpande
 
Posts: 692
Joined: Mon Apr 20, 2009 3:53 pm
Location: Cambridge


Return to SQL Refactor 1

Who is online

Users browsing this forum: No registered users and 0 guests