解决方案:PowerDesigner 16设置生成SQL column不含有collate chinese_prc_ci_as

今天在使用PowerDesigner 16设计数据库时,导出的sql语句在SqlServer中执行时,意外的让人悲催、抓狂、甚至想自杀!!!

其中就有如题这样的一个错误,看下面sql语句:

create table dbo.t_call_note (  
           id             int                  identity(100,1),   
           name           char(19)             collate Chinese_PRC_Stroke_90_CS_AS_KS_WS not null,  
           pwd            char(19)             collate Chinese_PRC_Stroke_90_CS_AS_KS_WS null, 
           constraint PK_T_CALL_INFO primary key (id)   on "PRIMARY"  
      )  
      on "PRIMARY"  
      go  

其中SqlServer报错:collate chinese_prc_ci_as意外。。。

上面的sql包含collate Chinese_PRC_Stroke_90_CS_AS_KS_WS not null,这是一种排序方式。

但是在执行sql时就会出现错误.如果column为int时就会报错。那么我们如果如下设置,问题不再是问题了。

解决方案:

  1.点击:工具栏-》database-》edit current DBMS

      2.选择数据源(以SqlServer2005为例)

      Microsoft SQLServer2005ScriptObjectsColumnAdd

在位置3插入下面代码:

%20:COLUMN% [%COMPUTE%?AS (%COMPUTE%):[%.L:DATATYPE%=xml?xml[%XMLSchemaCollection%?([%ContentType%]%XMLSchemaCollection.GeneratedName%):]:%20:DATATYPE%][%ExtRowGuidCol%? RowGuidCol][%IDENTITY%? %IDENTITY%[[(%ExtIdentitySeedInc%)][%ExtIdtNotForReplication%? not for replication]]:[%ExtNullConstName%? constraint %ExtNullConstName%][ %NULL%][ %NOTNULL%]][[%ExtDeftConstName%? constraint %ExtDeftConstName%] default %DEFAULT%][%CONSTDEFN%]]

保存即可。

重新生成。。。发现已经没有了。。collate chinese_prc_ci_as

惊喜!!!!

转载:https://www.cnblogs.com/lukun/archive/2013/04/20/3032881.html

原文地址:https://www.cnblogs.com/jiangqw/p/12530956.html