havmaage
havmaage

Reputation: 603

IMPORT DDL to CA Erwin Data Modeller r9.64 with comments

We are using Erwin to document and create our datamodels, i need to do some reverse engineering from time to time in order to import new data models after it has been developed. I have been playing around with importing DDL from MSSQL and it work fine

i can import this code from a file

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[SOME_TABLE]') AND type in (N'U'))
DROP TABLE [dbo].[SOME_TABLE]
GO
CREATE TABLE [dbo].[SOME_TABLE](
[PR_DATO]       [DATETIME] NOT NULL, 'dwh dato tilbrug for dwh'
[ACCOUNT]   [DECIMAL](3,0) NOT NULL,
[CASE][DECIMAL](12) NOT NULL,
[SOME_ID][DECIMAL](12) NOT NULL,
[DESCRIPTION][VARCHAR](60) NOT NULL,
[SIMONS_FELT] [VARCHAR](60) NOT NULL,
[SIMONS1_FELT] [VARCHAR](60) NOT NULL
CONSTRAINT[PK_SOME_TABLE]PRIMARY KEY CLUSTERED
(
 [PR_DATO] ASC
,[ACCOUNT]ASC
)ON [PRIMARY]
)ON [PRIMARY]
GO 

But then i have to manually add comments/metadata decription to every column and table. is it possible to add comments to table and columns in the ddl and import that to ERWIN

Upvotes: 0

Views: 928

Answers (1)

NK0709
NK0709

Reputation: 66

when you export out the ddl ,please export table and column comments as well. if you have already done please include an extended property code like below in the script.

EXECUTE sp_addextendedproperty N'MS_Description', 'My Column Comment', N'user', N'dbo', N'table', N'MyTableName', N'column', N'MyColumnName'

try to reverse engineer with the updated script and this should copy the comments as well.

Upvotes: 0

Related Questions