Skip to Content

Change [%PROCPRMS%] generation format

Hi

I’m studying PowerDesigner and try to do my project with physical database model.

In the storedproc’s template is a header string:

create procedure [%QUALIFIER%]%PROC% ([%PROCPRMS%]) as

Is has a built-in variable [%PROCPRMS%] that, instead of itself generation output a list of parameters of storedproc.

As a result we get that somthing like:

create procedure dbo.Proc1(param1 int, param2 nvarchar(10)) as
begin  
   ...
end

But when there are many parameters, then output list of parameters of storedproc to string (one line) is a bad choice, i think so.

For example:

create procedure dbo.Proc1(param1 uniqueidentifier, param2 nvarchar(10), param3 uniqueidentifier, param4 uniqueidentifier, param5 uniqueidentifier, param6 uniqueidentifier) as
begin  
    ...
end

Question:

Can I override the [%PROCPRMS%] behavior?

I need generate format as in the example below:

create procedure dbo.Proc1(
   param1 uniqueidentifier 
 , param2 nvarchar(10) 
 , param3 uniqueidentifier 
 , param4 uniqueidentifier 
 , param5 uniqueidentifier  
 , param6 uniqueidentifier
) as
begin  
    ...
end

or even better so:

create procedure
dbo.Proc1(   
    -- comment param1   
    param1 uniqueidentifier   
    -- comment param2 
  , param2 nvarchar(10)  
    -- comment param3 
  , param3 uniqueidentifier  
    -- comment param4 
  , param4 uniqueidentifier   
    -- comment param5 
  , param5 uniqueidentifier    
    -- comment param6 
  , param6 uniqueidentifier
) as
begin  
    ...
end
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Jul 19 at 09:03 PM

    I use SQL Server 2012 as example. This is the original format:

    I add some code to get stored procedure name and its parameter and comment. Build the parameter list. This is the code:

    Attached is the code:
    <a href="/storage/attachments/169935-code.txt">code.txt</a>
    Add comment
    10|10000 characters needed characters exceeded

  • Jul 19 at 09:15 PM
    Add comment
    10|10000 characters needed characters exceeded

  • Jul 19 at 09:15 PM
    Add comment
    10|10000 characters needed characters exceeded