Garbled characters appear in the SQL Server database generated by powerdesigner

Source: Internet
Author: User
Tags powerdesigner

In the past two days, we used PD for database modeling. When we started from PDM --> dB, Chinese remarks were garbled, such :??? (Dd)

I always thought about Chinese encoding, but I tried all Chinese encoding methods and still could not solve the problem.

The following is a problem with the SQL statement generated by PD. The sample script automatically generated by PD is as follows:

Execute Sp_addextendedproperty ' Ms_description ' ,
' Order No. ' ,
' User ' , ' DBO ' , ' Table ' , ' Orderinfo ' , ' Column ' , ' A1 '
Go

 

I took this script to the database for execution. The remarks on the generated fields are still garbled and changed the script:

Execute Sp_addextendedproperty ' Ms_description ' ,
N ' Agent fee ' ,
' Schema ' , ' DBO ' , ' Table ' , ' T1 ' , ' Column ' , ' Col1 '
Go

The text in the next section can be displayed normally.

Solution:

In PD, choose tools> resources> DBMS> SQL Server 2008 to open the DBMS attribute window, on the General tab, select Microsoft SQL Server 2008 --> script --> objects --> column --> columncomment and modify the content as follows:

Code
[ % Owner %? [. O: [Execute ] [ Exec ] ] Sp_addextendedproperty [ % R %? [N ] ] ' Ms_description ' ,
[ [N ] ] % . Q: Comment % ,
[ % R %? [N ] ] ' Schema ' , [ % R %? [N ] ] % . Q: Owner % , [ % R %? [N ] ] ' Table ' , [ % R %? [N ] ] % . Q: Table % , [ % R %? [N ] ] ' Column ' , [ % R %? [N ] ] % . Q: Column %
: Declare   @ Currentuser Sysname
Select   @ Currentuser   =   User_name ()
[ . O: [Execute ] [ Exec ] ] Sp_addextendedproperty [ % R %? [N ] ] ' Ms_description ' ,
[ [N ] ] % . Q: Comment % ,
[ % R %? [N ] ] ' Schema ' , [ % R %? [N ] ] @ Currentuser , [ % R %? [N ] ] ' Table ' , [ % R %? [N ] ] % . Q: Table % , [ % R %? [N ] ] ' Column ' , [ % R %? [N ] ] % . Q: Column %

 

Save and generate the database. The problem is solved.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.