Book a Demo

Author Topic: DEFAULT statement in SQL server DDL generation  (Read 4578 times)

Eelco

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • d'Oh
    • View Profile
DEFAULT statement in SQL server DDL generation
« on: December 01, 2005, 02:55:26 am »
When I generate DDL (for SQL Server 2000) from my DDL PSM, I get a DEFAULT statement for each created column, but without any value. This make my code unusable, is this a bug? And is there a work-around?

CREATE TABLE Hal (
Id uniqueidentifier DEFAULT  NOT NULL,
Naam text DEFAULT ,
Priority int DEFAULT ,
Rayon_Ref uniqueidentifier DEFAULT
)
« Last Edit: December 01, 2005, 02:56:05 am by Eelco »

thomaskilian

  • Guest
Re: DEFAULT statement in SQL server DDL generation
« Reply #1 on: December 01, 2005, 03:35:10 am »
Maybe you have a blank in the Initial field of the column properties? (just a guess)

Eelco

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • d'Oh
    • View Profile
Re: DEFAULT statement in SQL server DDL generation
« Reply #2 on: December 01, 2005, 03:46:02 am »
Not that I know ... the DDL psm is generated from a PIM, and I don't even know how to set that initial field from the template (that's another one of my questions on this forum  ;))

emquad

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: DEFAULT statement in SQL server DDL generation
« Reply #3 on: December 15, 2005, 05:15:27 am »
I also noticed the DEFAULT bug and I noticed that it is accompanied by the fact that you can't see a datatype for these columns in the attribute form.
This behavior is reproducible when you open the attribute form  by doubleclicking on the attribute and
you have never opened the table property form before.
The workaround is, to open the table property form and click Column/Attribute in the table Detail tab. This will repair it.

I'm not sure, this is the only case it occurs, but this hint might be helpful for someone.

Martin