Skip to Main Content

SQL Developer Data Modeler

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem with DDL generation with SQL Server User-Defined Data Types.

MiGli_1006342May 16 2013 — edited May 25 2013
Hi,

I am working with SDDM 3.3.0.747 on Windows 7.

I'd like to generate DDL for SQL Server 2008 database which will look similar to this:

-----
CREATE DEFAULT dbo.DEF_NA
AS 'N/A'
GO

CREATE TYPE dbo.DM_CH10
FROM nvarchar(10) NOT NULL
GO

EXECUTE sp_bindefault DEF_NA, 'DM_CH10'
GO

CREATE TABLE Table1
(
Column1 DM_CH10
)
-----

I have created UDDT Distinct Types in Data Type Model, defined default in Physical model for SQL Server 2008 and the best DDL I could get so far is like this:

-----
CREATE DEFAULT dbo.DEF_NA
AS 'N/A'
GO

CREATE TYPE dbo.DM_CH10
FROM NVARCHAR (10)
NOT NULL
GO

EXEC sp_bindefault 'dbo.DEF_NA', 'dbo.DM_CH10'
GO

CREATE TABLE dbo.Table_1
(
Column1 NVARCHAR (10) NOT NULL COLLATE Czech_100_CI_AS ,
)
GO

EXEC sp_bindefault 'DEF_NA' , 'Table_1.Column1'
GO
-----

What bothers me most is:
1. I cannot make DDL generator to use UDDT types in 'CREATE TABLE' statement
2. Even if I run this, 'CREATE TABLE' will fail as 'NOT NULL' must be specified after 'COLLATE Czech_100_CI_AS'
3. 'EXEC sp_bindefault' will fail if I have (and I do have) Table_1 in more than one schema.

Any help would be appreciated.

MilGl
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 22 2013
Added on May 16 2013
4 comments
869 views