0

I have a schema named "Core" and this schema has several domains (Id, Name, ...)

My DBMS is Microsoft SQL Server 2014.

This is the definition for "Name" domain: NameDomain

When I generate Sql the column tables haven't the domain schema: enter image description here

If I run the sql as PowerDesigner generates, I get an error telling me that not found "Id": Msg 2715, Level 16, State 6, Line 18 Column, parameter, or variable #1: Cannot find data type Id

When I manually write the schema before domain its works. This way:

create table Security.Table1 (
    Id                   Core.Id                   not null,
    Nombre               Core.Name                 not null
)

How to do to force generate sql with domains schema name?

Javier Ros
  • 3,511
  • 2
  • 21
  • 41
  • What is your target RDBMS, and does your desired `create table ... Core.Id ...` command work when manually run against the RDBMS? – markp-fuso Sep 04 '17 at 17:41
  • My DBMS is Microsoft SQL Server 2014. Yes when I manually write the schema before domain works, If I run the sql as PowerDesigner generates, I get an error telling me that not found "Id": `Msg 2715, Level 16, State 6, Line 18 Column, parameter, or variable #1: Cannot find data type Id.` – Javier Ros Sep 04 '17 at 17:45
  • It's been awhile since I've used PD, and then it wasn't against MSSQL; a few areas I'd check: 1) is there a (db generation) option for enabling the owner/schema on datatypes? 2) is the default owner/schema already set to 'Core' in which case PB might consider 'Core.Id' as redundant (and if so, what happens if you unset the default owner/schema, or set to 'dbo', or set to anything other than 'Core')? 3) look at customizing the DDL formats used by PB when generating DDL (though I'd consider this something that PB should do automatically if the datatype's owner/schema != default owner/schema) – markp-fuso Sep 04 '17 at 20:49
  • It is a bug that the `Owner prefix` generation `Format` option is not used for the type. You should report it, if you can. In the meantime, I can imagine a solution, not so easy... Create a modified version of the DBMS, to fix the `Script\Objects\Column\Add`item. Wrap the existing one with `[%R% ? ... : ...]`so that it is still used on reverse engineering, and write an alternative one which implements the `if attached_domain then use domain qualified code, else use column data type` logic... – pascal Sep 05 '17 at 06:09
  • Yes, the easy solution is to set no owner in the domain, this way MSSQL create it under "dbo" schema (default schema). – Javier Ros Sep 05 '17 at 06:25
  • @markp The default domain is user specific I can set de default domain for a user, but I don't know what user run sql scripts on the DB. – Javier Ros Sep 05 '17 at 06:25
  • @pascal the Power Designer web is not easy to find a place to report it, if you find it, I will report it. – Javier Ros Sep 05 '17 at 06:25

0 Answers0