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.